Class BasicFieldLink

java.lang.Object
org.tudalgo.algoutils.tutor.general.reflections.BasicLink
org.tudalgo.algoutils.tutor.general.reflections.BasicFieldLink
All Implemented Interfaces:
Identifiable, Stringifiable, FieldLink, Link, WithModifiers, WithName, WithType

public class BasicFieldLink extends BasicLink implements FieldLink
  • Nested Class Summary

    Link.Kind
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get()
    Returns the object assigned to the type of this field.
    <T> T
    get(Object instance)
    Returns the object assigned to the given instance.
    Returns the identifier of this identifiable object.
    int
    Return the bit representation of the modifiers of this link.
    Returns the name of this link.
    of(Field field)
     
    Returns the type of the field linked by this field link.
    void
    set(Object object)
    Sets the object assigned to the type of this field.
    void
    set(Object instance, Object object)
    Sets the object assigned to the given instance.
     
     
    equals

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    kind, link, type

    Methods inherited from interface org.tudalgo.algoutils.tutor.general.match.Identifiable

    string
  • Method Details

    • of

      public static BasicFieldLink of(Field field)
    • get

      public <T> T get()
      Description copied from interface: FieldLink

      Returns the object assigned to the type of this field.

      This field is required to be an class field.

      Specified by:
      get in interface FieldLink
      Returns:
      the object
    • get

      public <T> T get(Object instance)
      Description copied from interface: FieldLink

      Returns the object assigned to the given instance.

      This field is required to be an instance field.

      Specified by:
      get in interface FieldLink
      Parameters:
      instance - the instance
      Returns:
      the object
    • identifier

      public String identifier()
      Description copied from interface: Identifiable

      Returns the identifier of this identifiable object.

      Specified by:
      identifier in interface Identifiable
      Specified by:
      identifier in interface WithName
      Returns:
      the identifier
    • reflection

      public Field reflection()
      Description copied from interface: FieldLink

      Returns the type of the field linked by this field link.

      Specified by:
      reflection in interface FieldLink
      Specified by:
      reflection in interface Link
      Returns:
      the type
    • modifiers

      public int modifiers()
      Description copied from interface: WithModifiers

      Return the bit representation of the modifiers of this link.

      Specified by:
      modifiers in interface FieldLink
      Specified by:
      modifiers in interface WithModifiers
      Returns:
      the modifiers
    • staticType

      public TypeLink staticType()
      Specified by:
      staticType in interface FieldLink
    • set

      public void set(Object object)
      Description copied from interface: FieldLink

      Sets the object assigned to the type of this field.

      This field is required to be an class field.

      Specified by:
      set in interface FieldLink
      Parameters:
      object - the object
    • set

      public void set(Object instance, Object object)
      Description copied from interface: FieldLink

      Sets the object assigned to the given instance.

      This field is required to be an instance field.

      Specified by:
      set in interface FieldLink
      Parameters:
      instance - the instance
      object - the object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • name

      public String name()
      Description copied from interface: WithName

      Returns the name of this link.

      Specified by:
      name in interface WithName
      Returns:
      the name