@Override
    public int compareTo(FieldValue fieldValue) {
        int comp = super.compareTo(fieldValue);

        if (comp != 0) {
            return comp;
        }

        //types are equal, this must be of this type
        ByteFieldValue otherValue = (ByteFieldValue) fieldValue;
        if (value < otherValue.value) {
            return -1;
        } else if (value > otherValue.value) {
            return 1;
        } else {
            return 0;
        }
    }
A byte field value

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