Package io.github.pimak.ntfy.core
Record Class NtfyAction.Broadcast
java.lang.Object
java.lang.Record
io.github.pimak.ntfy.core.NtfyAction.Broadcast
- All Implemented Interfaces:
NtfyAction
- Enclosing interface:
NtfyAction
public static record NtfyAction.Broadcast(String label, String intent, List<NtfyAction.BroadcastExtra> extras, boolean clear)
extends Record
implements NtfyAction
Sends an Android broadcast intent when tapped (only actioned by ntfy's Android app).
intent defaults to ntfy's own default (io.heckel.ntfy.USER_ACTION) when blank;
each NtfyAction.BroadcastExtra in extras is passed as an intent extra.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.pimak.ntfy.core.NtfyAction
NtfyAction.Broadcast, NtfyAction.BroadcastExtra, NtfyAction.Http, NtfyAction.HttpHeader, NtfyAction.View -
Constructor Summary
ConstructorsConstructorDescriptionBroadcast(String label, String intent, List<NtfyAction.BroadcastExtra> extras, boolean clear) Creates an instance of aBroadcastrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanclear()Returns the value of theclearrecord component.final booleanIndicates whether some other object is "equal to" this one.extras()Returns the value of theextrasrecord component.final inthashCode()Returns a hash code value for this object.intent()Returns the value of theintentrecord component.label()Returns the value of thelabelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Broadcast
public Broadcast(String label, String intent, List<NtfyAction.BroadcastExtra> extras, boolean clear) Creates an instance of aBroadcastrecord class.- Parameters:
label- the value for thelabelrecord componentintent- the value for theintentrecord componentextras- the value for theextrasrecord componentclear- the value for theclearrecord component
-
-
Method Details
-
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 '=='. -
label
Returns the value of thelabelrecord component.- Specified by:
labelin interfaceNtfyAction- Returns:
- the value of the
labelrecord component
-
intent
Returns the value of theintentrecord component.- Returns:
- the value of the
intentrecord component
-
extras
Returns the value of theextrasrecord component.- Returns:
- the value of the
extrasrecord component
-
clear
public boolean clear()Returns the value of theclearrecord component.- Returns:
- the value of the
clearrecord component
-