Record Class CachedWayNet

java.lang.Object
java.lang.Record
dev.gothickit.zenkit.way.CachedWayNet
All Implemented Interfaces:
CacheableObject<CachedWayNet>, WayNet

public record CachedWayNet(@NotNull WayEdge @NotNull [] edges, @NotNull List<@NotNull WayPoint> points) extends Record implements WayNet
  • Constructor Details

    • CachedWayNet

      public CachedWayNet(@NotNull @NotNull WayEdge @NotNull [] edges, @NotNull @NotNull List<@NotNull WayPoint> points)
      Creates an instance of a CachedWayNet record class.
      Parameters:
      edges - the value for the edges record component
      points - the value for the points record component
  • Method Details

    • pointCount

      public long pointCount()
      Specified by:
      pointCount in interface WayNet
    • point

      @Nullable public @Nullable WayPoint point(long i)
      Specified by:
      point in interface WayNet
    • cache

      @NotNull public @NotNull CachedWayNet cache()
      Specified by:
      cache in interface CacheableObject<CachedWayNet>
    • isCached

      public boolean isCached()
      Specified by:
      isCached in interface CacheableObject<CachedWayNet>
    • 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.
    • edges

      @NotNull public @NotNull WayEdge @NotNull [] edges()
      Returns the value of the edges record component.
      Specified by:
      edges in interface WayNet
      Returns:
      the value of the edges record component
    • points

      @NotNull public @NotNull List<@NotNull WayPoint> points()
      Returns the value of the points record component.
      Specified by:
      points in interface WayNet
      Returns:
      the value of the points record component