Record Class View<A,B>

java.lang.Object
java.lang.Record
com.mojang.datafixers.View<A,B>
All Implemented Interfaces:
App2<com.mojang.datafixers.View.Mu,A,B>

public record View<A,B>(PointFree<Function<A,B>> function) extends Record implements App2<com.mojang.datafixers.View.Mu,A,B>
  • Constructor Details

    • View

      public View(PointFree<Function<A,B>> function)
      Creates an instance of a View record class.
      Parameters:
      function - the value for the function record component
  • Method Details

    • nopView

      public static <A> View<A,A> nopView(Type<A> type)
    • type

      public Type<A> type()
    • newType

      public Type<B> newType()
    • funcType

      public Type<Function<A,B>> funcType()
    • toString

      public 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
    • rewrite

      public Optional<? extends View<A,B>> rewrite(PointFreeRule rule)
    • rewriteOrNop

      public View<A,B> rewriteOrNop(PointFreeRule rule)
    • flatMap

      public <C> View<A,C> flatMap(Function<Type<B>,View<B,C>> function)
    • create

      public static <A, B> View<A,B> create(PointFree<Function<A,B>> function)
    • create

      public static <A, B> View<A,B> create(String name, Type<A> type, Type<B> newType, Function<DynamicOps<?>,Function<A,B>> function)
    • compose

      public <C> View<C,B> compose(View<C,A> that)
    • isNop

      public boolean isNop()
    • 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.
    • function

      public PointFree<Function<A,B>> function()
      Returns the value of the function record component.
      Returns:
      the value of the function record component