@Override
    public void assign(Object o) {
        if (!checkAssign(o)) {
            return;
        }
        if (o instanceof Number) {
            value = ((Number) o).byteValue();
        } else if (o instanceof NumericFieldValue) {
            value = ((NumericFieldValue) o).getNumber().byteValue();
        } else if (o instanceof String || o instanceof StringFieldValue) {
            value = Byte.parseByte(o.toString());
        } else {
            throw new IllegalArgumentException("Class " + o.getClass() + " not applicable to an " + this.getClass() + " instance.");
        }
    }
A byte field value

@author Einar M R Rosenvinge
document/src/main/java/com/yahoo/document/datatypes/ByteFieldValue.java