Record Class StoreChooser.Need

java.lang.Object
java.lang.Record
ai.badmonkey.agentspaces.planner.StoreChooser.Need
Record Components:
bytes - the bytes the root holds
copies - how many stores should hold it
sealed - whether the content is sealed (sealed nodes or sealed hashing), so a blind store may hold it
tier - the tier wanted, or null for any
maxPrice - the highest price per GiB-month, or null for any
avoid - stores not to choose, such as ones that failed challenges
Enclosing class:
StoreChooser

public static record StoreChooser.Need(long bytes, int copies, boolean sealed, String tier, Long maxPrice, Set<PeerId> avoid) extends Record
What a root needs from its stores.
  • Constructor Details

    • Need

      public Need(long bytes, int copies, boolean sealed, String tier, Long maxPrice, Set<PeerId> avoid)
      Creates an instance of a Need record class.
      Parameters:
      bytes - the value for the bytes record component
      copies - the value for the copies record component
      sealed - the value for the sealed record component
      tier - the value for the tier record component
      maxPrice - the value for the maxPrice record component
      avoid - the value for the avoid record component
  • Method Details

    • of

      public static StoreChooser.Need of(long bytes, int copies)
      A need of plain content in any tier at any price.
    • sealed

      public StoreChooser.Need sealed(boolean value)
    • tier

      public StoreChooser.Need tier(String value)
    • maxPrice

      public StoreChooser.Need maxPrice(long value)
    • avoid

      public StoreChooser.Need avoid(Set<PeerId> value)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • bytes

      public long bytes()
      Returns the value of the bytes record component.
      Returns:
      the value of the bytes record component
    • copies

      public int copies()
      Returns the value of the copies record component.
      Returns:
      the value of the copies record component
    • sealed

      public boolean sealed()
      Returns the value of the sealed record component.
      Returns:
      the value of the sealed record component
    • tier

      public String tier()
      Returns the value of the tier record component.
      Returns:
      the value of the tier record component
    • maxPrice

      public Long maxPrice()
      Returns the value of the maxPrice record component.
      Returns:
      the value of the maxPrice record component
    • avoid

      public Set<PeerId> avoid()
      Returns the value of the avoid record component.
      Returns:
      the value of the avoid record component