All Superinterfaces:
Identifiable, Link, Stringifiable, WithModifiers, WithName, WithType
All Known Implementing Classes:
BasicFieldLink

public interface FieldLink extends Link, WithModifiers, WithName, WithType

An interface used to simply access fields.

  • 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.
    default Link.Kind
     
    default Field
    Deprecated.
    use reflection() instead
    default int
    Return the bit representation of the modifiers of this link.
    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.
     
    default TypeLink
    Returns the type of this link.

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

    string

    Methods inherited from interface org.tudalgo.algoutils.tutor.general.reflections.WithName

    identifier, name
  • Method Details

    • get

      <T> T get()

      Returns the object assigned to the type of this field.

      This field is required to be an class field.

      Returns:
      the object
    • get

      <T> T get(Object instance)

      Returns the object assigned to the given instance.

      This field is required to be an instance field.

      Parameters:
      instance - the instance
      Returns:
      the object
    • link

      @Deprecated default Field link()
      Deprecated.
      use reflection() instead
    • reflection

      Field reflection()

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

      Specified by:
      reflection in interface Link
      Returns:
      the type
    • set

      void set(Object object)

      Sets the object assigned to the type of this field.

      This field is required to be an class field.

      Parameters:
      object - the object
    • set

      void set(Object instance, Object object)

      Sets the object assigned to the given instance.

      This field is required to be an instance field.

      Parameters:
      instance - the instance
      object - the object
    • kind

      default Link.Kind kind()
      Specified by:
      kind in interface Link
    • modifiers

      default int modifiers()
      Description copied from interface: WithModifiers

      Return the bit representation of the modifiers of this link.

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

      TypeLink staticType()
    • type

      default TypeLink type()
      Description copied from interface: WithType

      Returns the type of this link.

      Specified by:
      type in interface WithType
      Returns:
      the type