Package google.registry.beam.spec11
Record Class ThreatMatch
java.lang.Object
java.lang.Record
google.registry.beam.spec11.ThreatMatch
- Record Components:
threatType
- What kind of threat this is (malware, phishing, etc.).domainName
- The fully qualified domain name of the matched threat.
- All Implemented Interfaces:
Serializable
public record ThreatMatch(String threatType, String domainName)
extends Record
implements Serializable
A record representing a threat match response from the
SafeBrowsing API
.- See Also:
-
Constructor Summary
ConstructorDescriptionThreatMatch
(String threatType, String domainName) Creates an instance of aThreatMatch
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedomainName
record component.final boolean
Indicates whether some other object is "equal to" this one.static ThreatMatch
fromJSON
(org.json.JSONObject threatMatch) Parses aJSONObject
and returns an equivalentThreatMatch
.final int
hashCode()
Returns a hash code value for this object.Returns the value of thethreatType
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ThreatMatch
Creates an instance of aThreatMatch
record class.- Parameters:
threatType
- the value for thethreatType
record componentdomainName
- the value for thedomainName
record component
-
-
Method Details
-
fromJSON
Parses aJSONObject
and returns an equivalentThreatMatch
.- Throws:
org.json.JSONException
-
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)
. -
threatType
Returns the value of thethreatType
record component.- Returns:
- the value of the
threatType
record component
-
domainName
Returns the value of thedomainName
record component.- Returns:
- the value of the
domainName
record component
-