Package io.github.pimak.ntfy.core
Record Class NtfyAction.Http
java.lang.Object
java.lang.Record
io.github.pimak.ntfy.core.NtfyAction.Http
- All Implemented Interfaces:
NtfyAction
- Enclosing interface:
NtfyAction
public static record NtfyAction.Http(String label, String url, String method, String body, boolean clear, List<NtfyAction.HttpHeader> headers)
extends Record
implements NtfyAction
Sends an HTTP request to
url when tapped. method defaults to ntfy's own default
(POST) when blank; body is sent as the request body when non-blank; each NtfyAction.HttpHeader in headers is sent as a request header.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.booleanclear()Returns the value of theclearrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.label()Returns the value of thelabelrecord component.method()Returns the value of themethodrecord component.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.
-
Constructor Details
-
Http
public Http(String label, String url, String method, String body, boolean clear, List<NtfyAction.HttpHeader> headers) Creates an instance of aHttprecord class.- Parameters:
label- the value for thelabelrecord componenturl- the value for theurlrecord componentmethod- the value for themethodrecord componentbody- the value for thebodyrecord componentclear- the value for theclearrecord componentheaders- the value for theheadersrecord 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
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
clear
public boolean clear()Returns the value of theclearrecord component.- Returns:
- the value of the
clearrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-