Class ObjectStreamField

  • All Implemented Interfaces:
    java.lang.Comparable

    public class ObjectStreamField
    extends java.lang.Object
    implements java.lang.Comparable
    A description of a field in a serializable class. A array of these is used to declare the persistent fields of a class.
    • Field Detail

      • bridge

        private static final org.glassfish.pfl.basic.reflection.Bridge bridge
      • name

        private java.lang.String name
      • type

        private char type
      • field

        private java.lang.reflect.Field field
      • typeString

        private java.lang.String typeString
      • clazz

        private java.lang.Class clazz
      • signature

        private java.lang.String signature
      • fieldID

        private long fieldID
    • Constructor Detail

      • ObjectStreamField

        public ObjectStreamField​(java.lang.String n,
                                 java.lang.Class clazz)
      • ObjectStreamField

        public ObjectStreamField​(java.lang.reflect.Field field)
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of this field.
        Returns:
        The field name
      • getType

        public java.lang.Class getType()
        Get the type of the field.
        Returns:
        The type of the field
      • getTypeCode

        public char getTypeCode()
      • getTypeString

        public java.lang.String getTypeString()
      • getField

        java.lang.reflect.Field getField()
      • setField

        void setField​(java.lang.reflect.Field field)
      • isPrimitive

        public boolean isPrimitive()
        test if this field is a primitive or not.
        Returns:
        if this field is primitive.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Compare this with another ObjectStreamField. return -1 if this is smaller, 0 if equal, 1 if greater types that are primitives are "smaller" than objects. if equal, the names are compared.
        Specified by:
        compareTo in interface java.lang.Comparable
      • typeEquals

        public boolean typeEquals​(ObjectStreamField other)
        Compare the types of two class descriptors. The match if they have the same primitive types. or if they are both objects and the object types match.
        Parameters:
        other - type to compare with
        Returns:
        if the two types are equivalent
      • getSignature

        public java.lang.String getSignature()
      • toString

        public java.lang.String toString()
        Return a string describing this field.
        Overrides:
        toString in class java.lang.Object
      • getClazz

        public java.lang.Class getClazz()
      • getFieldID

        public long getFieldID()