Record Class JobsRest.Restock
java.lang.Object
java.lang.Record
org.apache.juneau.petstore.console.ops.JobsRest.Restock
- Record Components:
perSpecies- How many pets of each species to add (1-50 each).idempotencyKey- The client-minted key; resubmits with the same key return the same job.slowMs- How long to wait before restocking, in whole milliseconds (0-10000), so a demo can cancel before the effect.holdMs- How long to hold after restocking, in whole milliseconds (0-10000, default 1000), so a demo can cancel after the effect.
- Enclosing class:
- JobsRest
public static record JobsRest.Restock(Map<Species,Integer> perSpecies, String idempotencyKey, int slowMs, int holdMs)
extends Record
The restock request.
Example:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intholdMs()Returns the value of theholdMsrecord component.Returns the value of theidempotencyKeyrecord component.static JobsRest.RestockReads a restock from any of its wire shapes: the API form{perSpecies:{DOG:2}, idempotencyKey}, the dialog form the views runtime posts,{action, targetId, idempotencyKey, fields:{DOG:"2"}}, or the job-log card's flat form{DOG:2, slowMs:0, idempotencyKey}.Returns the value of theperSpeciesrecord component.intslowMs()Returns the value of theslowMsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Restock
Creates an instance of aRestockrecord class.- Parameters:
perSpecies- the value for theperSpeciesrecord componentidempotencyKey- the value for theidempotencyKeyrecord componentslowMs- the value for theslowMsrecord componentholdMs- the value for theholdMsrecord component
-
-
Method Details
-
of
Reads a restock from any of its wire shapes: the API form{perSpecies:{DOG:2}, idempotencyKey}, the dialog form the views runtime posts,{action, targetId, idempotencyKey, fields:{DOG:"2"}}, or the job-log card's flat form{DOG:2, slowMs:0, idempotencyKey}. In the dialog and flat forms a blank,null or0count means "none of that species". Any form may carryslowMsandholdMs; each must be a whole number of milliseconds, so a decimal such as1.5is rejected rather than truncated.- Parameters:
body- The request body.- Returns:
- The restock.
- Throws:
BadRequest- If a species is unknown, a count is not a whole number,slowMsis not a whole number 0-10000, orholdMsis not a whole number 0-10000.
-
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. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
perSpecies
Returns the value of theperSpeciesrecord component.- Returns:
- the value of the
perSpeciesrecord component
-
idempotencyKey
Returns the value of theidempotencyKeyrecord component.- Returns:
- the value of the
idempotencyKeyrecord component
-
slowMs
Returns the value of theslowMsrecord component.- Returns:
- the value of the
slowMsrecord component
-
holdMs
Returns the value of theholdMsrecord component.- Returns:
- the value of the
holdMsrecord component
-