Class FieldScanner.FieldKey

java.lang.Object
org.simpleframework.xml.core.FieldScanner.FieldKey
Enclosing class:
FieldScanner

private static class FieldScanner.FieldKey extends Object
The FieldKey object is used to create a key that can store a contact using a field without using the methods of hashCode and equals on the field directly, as these can perform poorly on certain platforms.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    This is the name of the field that this represents.
    private final Class
    This is the class that the field has been declared on.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FieldKey(Field field)
    Constructor of the FieldKey object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object value)
    This method is used to compare this key to other keys.
    private boolean
    This method is used to compare this key to other keys.
    int
    This is basically the hash code for the field name.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • type

      private final Class type
      This is the class that the field has been declared on.
    • name

      private final String name
      This is the name of the field that this represents.
  • Constructor Details

    • FieldKey

      public FieldKey(Field field)
      Constructor of the FieldKey object. This is used to create an object that can reference something in a similar manner to a field.
      Parameters:
      field - this is the field to create the key with
  • Method Details

    • hashCode

      public int hashCode()
      This is basically the hash code for the field name. Because field names are unique within a class collisions using just the name for the hash code should be infrequent.
      Overrides:
      hashCode in class Object
      Returns:
      this returns the hash code for this key
    • equals

      public boolean equals(Object value)
      This method is used to compare this key to other keys. The declaring class and the name of the field are used to test for equality. If both are the same this returns true.
      Overrides:
      equals in class Object
      Parameters:
      value - this is the value that is to be compared to
      Returns:
      this returns true if the field values are equal
    • equals

      private boolean equals(FieldScanner.FieldKey other)
      This method is used to compare this key to other keys. The declaring class and the name of the field are used to test for equality. If both are the same this returns true.
      Parameters:
      other - this is the value that is to be compared to
      Returns:
      this returns true if the field values are equal