Record Class Directive

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.io.dlgp.Directive
Record Components:
type - the directive kind
value - the directive payload

public record Directive(Directive.Type type, Object value) extends Record
Represents a DLGP directive and its associated payload.
Author:
Clément Sipieter (INRIA) <clement@6pi.fr>

Directives are objects of the DLGP language that are parsed but are not facts, rules or queries.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enumerates the supported DLGP directive kinds.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new directive with the given type and value
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    Returns the directive kind.
    Returns the directive payload.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Directive

      public Directive(Directive.Type type, Object value)
      Creates a new directive with the given type and value
      Parameters:
      type - type of the directive
      value - value of the directive
  • Method Details

    • type

      public Directive.Type type()
      Returns the directive kind.
      Returns:
      the type
    • value

      public Object value()
      Returns the directive payload.
      Returns:
      the text
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.