Record Class Scope

java.lang.Object
java.lang.Record
org.microbean.scope.Scope
All Implemented Interfaces:
Constable, ScopeMember

public record Scope(org.microbean.qualifier.NamedAttributeMap<?> id, boolean normal, org.microbean.qualifier.NamedAttributeMap<?> governingScopeId) extends Record implements Constable, ScopeMember
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Scope
     
    static final org.microbean.qualifier.NamedAttributeMap<?>
     
    static final Scope
     
    static final org.microbean.qualifier.NamedAttributeMap<?>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Scope(org.microbean.qualifier.NamedAttributeMap<?> id, boolean normal, org.microbean.qualifier.NamedAttributeMap<?> governingScopeId)
    Creates an instance of a Scope record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final Optional<? extends ConstantDesc>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    org.microbean.qualifier.NamedAttributeMap<?>
    Returns the value of the governingScopeId record component.
    final int
    Returns a hash code value for this object.
    org.microbean.qualifier.NamedAttributeMap<?>
    id()
    Returns the value of the id record component.
    boolean
    Returns the value of the normal record component.
    static final Scope
    of(org.microbean.qualifier.NamedAttributeMap<?> id, boolean normal, org.microbean.qualifier.NamedAttributeMap<?> governingScopeId)
     
    final boolean
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.microbean.scope.ScopeMember

    governedBy
  • Field Details

    • SINGLETON_ID

      public static final org.microbean.qualifier.NamedAttributeMap<?> SINGLETON_ID
    • SINGLETON

      public static final Scope SINGLETON
    • NONE_ID

      public static final org.microbean.qualifier.NamedAttributeMap<?> NONE_ID
    • NONE

      public static final Scope NONE
  • Constructor Details

    • Scope

      public Scope(org.microbean.qualifier.NamedAttributeMap<?> id, boolean normal, org.microbean.qualifier.NamedAttributeMap<?> governingScopeId)
      Creates an instance of a Scope record class.
      Parameters:
      id - the value for the id record component
      normal - the value for the normal record component
      governingScopeId - the value for the governingScopeId record component
  • Method Details

    • describeConstable

      public final Optional<? extends ConstantDesc> describeConstable()
      Specified by:
      describeConstable in interface Constable
    • primordial

      public final boolean primordial()
    • of

      public static final Scope of(org.microbean.qualifier.NamedAttributeMap<?> id, boolean normal, org.microbean.qualifier.NamedAttributeMap<?> governingScopeId)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • id

      public org.microbean.qualifier.NamedAttributeMap<?> id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • normal

      public boolean normal()
      Returns the value of the normal record component.
      Returns:
      the value of the normal record component
    • governingScopeId

      public org.microbean.qualifier.NamedAttributeMap<?> governingScopeId()
      Returns the value of the governingScopeId record component.
      Specified by:
      governingScopeId in interface ScopeMember
      Returns:
      the value of the governingScopeId record component