public class ShortType extends IntegralType<Short>
name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
ShortType() |
Modifier and Type | Method and Description |
---|---|
protected Short |
convertNumber(Number value) |
protected Short |
downCast(long value) |
Short |
validate(Object obj)
Verify the given object is a valid instance of this
FieldType 's Java type and cast it to that type. |
hasPrefix0x00, hasPrefix0xff, read, skip, upCast, write
compare, convert, equals, fromParseableString, hashCode, toParseableString
fromString, genericizeForIndex, getDefaultValue, getDefaultValueObject, getEncodingSignature, getKeyRange, getName, getTypeToken, toString, toString, validateAndWrite
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected Short convertNumber(Number value)
convertNumber
in class PrimitiveType<Short>
protected Short downCast(long value)
downCast
in class IntegralType<Short>
public Short validate(Object obj)
FieldType
FieldType
's Java type and cast it to that type.
Note that this method must throw IllegalArgumentException
, not ClassCastException
or NullPointerException
, if obj
does not have the correct type, or is an illegal null value.
This method is allowed to perform widening conversions of the object that lose no information, e.g.,
from Integer
to Long
.
The implementation in FieldType
simply casts the value using this instance's raw Java type.
Subclasses should override this method to implement any other restrictions, e.g., disallowing null values.
validate
in class PrimitiveType<Short>
obj
- object to validateobj
cast to this field's typeCopyright © 2022. All rights reserved.