Record Class Product
java.lang.Object
java.lang.Record
co.yellowdog.platform.clients.web.Product
- Record Components:
name- the application's name, such as its package or artifact nameversion- the application's version
Identifies an application in the User-Agent header that the SDK sends. The SDK adds it after its own version and
the Java version, e.g.
yd/1.1.0 yellowdog-sdk-java/16.13.0 java/21 my-app/1.2.0.
The name and version should each be a token, as defined in
RFC 9110 section 5.6.2. That is one or more
ASCII letters, digits or any of !#$%&'*+-.^_`|~. If either isn't, a warning is logged and a token is sent in
its place. Whitespace at either end is removed, and other whitespace becomes _. A slash becomes #.
Other control characters are removed, and any other character that isn't allowed becomes _. A name or
version left empty is sent as unknown.
-
Constructor Summary
Constructors -
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.@NonNull Stringname()Returns the value of thenamerecord component.static ProductCreates a product with the given name and version.final StringtoString()Returns a string representation of this record class.@NonNull Stringversion()Returns the value of theversionrecord component.
-
Constructor Details
-
Product
-
-
Method Details
-
of
Creates a product with the given name and version.- Parameters:
name- the application's name, such as its package or artifact nameversion- the application's version- Returns:
- the product
- Throws:
NullPointerException- if the name or version is null
-
toString
-
hashCode
-
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). -
name
-
version
-