package org.ringingmaster.engine.touch.element;

import javax.annotation.concurrent.Immutable;
import org.ringingmaster.engine.touch.variance.Variance;

import java.util.Optional;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * TODO Comments
 *
 * @author Lake
 */
@Immutable
public class Element {

    private final String character;
    private final Optional<Variance> variance;


    public Element(char character) {
        this(character,Optional.empty());
    }

    public Element(char character, Optional<Variance> variance) {
        this.character = Character.toString(character);
        this.variance = checkNotNull(variance);
    }

    public String getCharacter() {
        return character;
    }

    public Optional<Variance> getVariance() {
        return variance;
    }

    @Override
    public String toString() {
        return "Element{" +
                "character=" + character +
                ", variance=" + variance +
                '}';
    }
}

@@ -46,54 +46,8 @@
 t;%0A%0A
-import javax.annotation.concurrent.Immutable;%0A
 impo
@@ -100,16 +100,62 @@
 iance;%0A%0A
+import javax.annotation.concurrent.Immutable;%0A
 import j
@@ -401,16 +401,104 @@
 ariance;
+ //TODO we should be able to simply enter variances as text instead of special handling.
 %0A%0A%0A    p

add TODO