Package dev.gmitch215.bytebox.gradle
Record Class DurableObjects
java.lang.Object
java.lang.Record
dev.gmitch215.bytebox.gradle.DurableObjects
- Record Components:
className- the fully qualified Java class namesockets- whether it takes WebSocketsalarms- whether it takes alarms
- All Implemented Interfaces:
Serializable
public record DurableObjects(String className, boolean sockets, boolean alarms)
extends Record
implements Serializable
A Durable Object class written in Java, and which of its handlers exist.
Read from the class the same way a Worker's triggers are: the interfaces it implements are already the answer, so the generated JavaScript class exposes a handler only where there is one to call.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDurableObjects(String className, boolean sockets, boolean alarms) Creates an instance of aDurableObjectsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanalarms()Returns the value of thealarmsrecord component.Returns the binding name, which isDO_and the class name upper-snaked.Returns the value of theclassNamerecord component.final booleanIndicates whether some other object is "equal to" this one.The prefix every export for this object shares.final inthashCode()Returns a hash code value for this object.static List<DurableObjects> Reads each named class.Returns the class's simple name, which is what the binding and the JavaScript class are called.booleansockets()Returns the value of thesocketsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
simpleName
Returns the class's simple name, which is what the binding and the JavaScript class are called.- Returns:
- the class's simple name, which is what the binding and the JavaScript class are called
-
bindingName
Returns the binding name, which isDO_and the class name upper-snaked.Derived by the same code the bindings block uses. The plugin declares a binding for any Durable Object that has none, deciding by this name, so a second derivation that disagreed with that one would declare the same binding twice.
- Returns:
- the binding name, which is
DO_and the class name upper-snaked
-
exportPrefix
The prefix every export for this object shares.- Returns:
- the prefix
-
of
Reads each named class.Loaded without initialising, so no user code runs.
- Parameters:
classNames- the fully qualified class namesclasspath- where to find them and the interfaces they implement- Returns:
- one entry per class, in the order named
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
className
Returns the value of theclassNamerecord component.- Returns:
- the value of the
classNamerecord component
-
sockets
public boolean sockets()Returns the value of thesocketsrecord component.- Returns:
- the value of the
socketsrecord component
-
alarms
public boolean alarms()Returns the value of thealarmsrecord component.- Returns:
- the value of the
alarmsrecord component
-