Package dev.gmitch215.bytebox.gradle
Record Class Binding
java.lang.Object
java.lang.Record
dev.gmitch215.bytebox.gradle.Binding
- Record Components:
type- what kind of binding this isname- the binding name, which is whatenvis keyed byidentifiers- the Wrangler keys for this type, in the order Wrangler expects them
- All Implemented Interfaces:
Serializable
public record Binding(BindingType type, String name, Map<String,String> identifiers)
extends Record
implements Serializable
One declared binding, with the name it resolved to.
Identifiers are optional throughout. Wrangler provisions a resource it cannot find, so a project that has not created its KV namespace yet still builds and deploys; an identifier is for pointing a binding at a resource whose remote name differs from the binding's.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBinding(BindingType type, String name) Creates an instance of aBindingrecord class. -
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.Returns the value of theidentifiersrecord component.name()Returns the value of thenamerecord component.toConfig()This binding as the object Wrangler expects underBindingType.configKey().final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Binding
Creates an instance of aBindingrecord class.- Parameters:
type- the value for thetyperecord componentname- the value for thenamerecord componentidentifiers- the value for theidentifiersrecord component
-
Binding
- Parameters:
type- what kind of binding this isname- the binding name
-
-
Method Details
-
toConfig
This binding as the object Wrangler expects underBindingType.configKey().The key holding the binding name differs by type —
bindingfor most,namefor a Durable Object or a Workflow,queuefor a producer — which is why this is not one shape with the name substituted.- Returns:
- the entry, with the name key first so the generated configuration reads naturally
-
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
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
identifiers
Returns the value of theidentifiersrecord component.- Returns:
- the value of the
identifiersrecord component
-