Package org.kiwiproject.beta.base.jar
Record Class ManifestLookupResult
java.lang.Object
java.lang.Record
org.kiwiproject.beta.base.jar.ManifestLookupResult
- Record Components:
lookupStatus- the lookup statusmanifest- the Manifest, or null if the lookup failed for any reasonerror- the Exception that occurred during a failed lookup, or null if the cause was not an exceptionerrorMessage- an error message describing the cause of the lookup failure
public record ManifestLookupResult(ManifestLookupStatus lookupStatus, @Nullable Manifest manifest, @Nullable Exception error, @Nullable String errorMessage)
extends Record
A record that contains lookup status and, if the lookup succeeded, a
Manifest.-
Constructor Summary
ConstructorsConstructorDescriptionManifestLookupResult(ManifestLookupStatus lookupStatus, @Nullable Manifest manifest, @Nullable Exception error, @Nullable String errorMessage) Creates an instance of aManifestLookupResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable Exceptionerror()Returns the value of theerrorrecord component.@Nullable StringReturns the value of theerrorMessagerecord component.booleanfailed()final inthashCode()Returns a hash code value for this object.Returns the value of thelookupStatusrecord component.@Nullable Manifestmanifest()Returns the value of themanifestrecord component.Return the Manifest if non-null.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ManifestLookupResult
public ManifestLookupResult(ManifestLookupStatus lookupStatus, @Nullable Manifest manifest, @Nullable Exception error, @Nullable String errorMessage) Creates an instance of aManifestLookupResultrecord class.- Parameters:
lookupStatus- the value for thelookupStatusrecord componentmanifest- the value for themanifestrecord componenterror- the value for theerrorrecord componenterrorMessage- the value for theerrorMessagerecord component
-
-
Method Details
-
failed
public boolean failed()- Returns:
- true if the lookup failed for any reason, otherwise true
-
succeeded
public boolean succeeded()- Returns:
- true if the lookup succeeded, otherwise false
-
maybeManifest
- Returns:
- an Optional wrapping the manifest
-
manifestOrThrow
Return the Manifest if non-null. Otherwise, throw anIllegalStateException.- Returns:
- the manifest if not-null
- Throws:
IllegalStateException- if the Manifest is null
-
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). -
lookupStatus
Returns the value of thelookupStatusrecord component.- Returns:
- the value of the
lookupStatusrecord component
-
manifest
Returns the value of themanifestrecord component.- Returns:
- the value of the
manifestrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-