Record Class MudlibProjection

java.lang.Object
java.lang.Record
io.github.protasm.jvmud.engine.mudlib.MudlibProjection

public record MudlibProjection(String sourcePath, Object object, Set<MudlibProjectionRole> roles) extends Record
Opaque mudlib-side projection attached to JVMud-native Player or Persona records.

This records the adapter meaning of a mudlib object without making that object define JVMud's engine ontology. LP245's /obj/player.c, for example, is a combined projection that carries login/profile policy and Persona behavior in one LPC object.

  • Constructor Details

    • MudlibProjection

      public MudlibProjection(String sourcePath, Object object, Set<MudlibProjectionRole> roles)
      Creates an instance of a MudlibProjection record class.
      Parameters:
      sourcePath - the value for the sourcePath record component
      object - the value for the object record component
      roles - the value for the roles record component
  • Method Details

    • combinedPlayerPersona

      public static MudlibProjection combinedPlayerPersona(String sourcePath, Object object)
    • personaBehavior

      public static MudlibProjection personaBehavior(String sourcePath, Object object)
    • hasRole

      public boolean hasRole(MudlibProjectionRole role)
    • 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.
    • sourcePath

      public String sourcePath()
      Returns the value of the sourcePath record component.
      Returns:
      the value of the sourcePath record component
    • object

      public Object object()
      Returns the value of the object record component.
      Returns:
      the value of the object record component
    • roles

      public Set<MudlibProjectionRole> roles()
      Returns the value of the roles record component.
      Returns:
      the value of the roles record component