Package io.thestencil.staticontent.api
Class ImmutableImageResource
- java.lang.Object
-
- io.thestencil.staticontent.api.ImmutableImageResource
-
- All Implemented Interfaces:
StaticContentClient.ImageResource
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableImageResource extends Object implements StaticContentClient.ImageResource
Immutable implementation ofStaticContentClient.ImageResource.Use the builder to create immutable instances:
ImmutableImageResource.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableImageResource.BuilderBuilds instances of typeImmutableImageResource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableImageResource.Builderbuilder()Creates a builder forImmutableImageResource.static ImmutableImageResourcecopyOf(StaticContentClient.ImageResource instance)Creates an immutable copy of aStaticContentClient.ImageResourcevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableImageResourcethat have equal attribute values.StringgetPath()byte[]getValue()inthashCode()Computes a hash code from attributes:path,value.StringtoString()Prints the immutable valueImageResourcewith attribute values.ImmutableImageResourcewithPath(String value)Copy the current immutable object by setting a value for thepathattribute.ImmutableImageResourcewithValue(byte... elements)Copy the current immutable object with elements that replace the content ofvalue.
-
-
-
Method Detail
-
getPath
public String getPath()
- Specified by:
getPathin interfaceStaticContentClient.ImageResource- Returns:
- The value of the
pathattribute
-
getValue
public byte[] getValue()
- Specified by:
getValuein interfaceStaticContentClient.ImageResource- Returns:
- A cloned
valuearray
-
withPath
public final ImmutableImageResource withPath(String value)
Copy the current immutable object by setting a value for thepathattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for path- Returns:
- A modified copy of the
thisobject
-
withValue
public final ImmutableImageResource withValue(byte... elements)
Copy the current immutable object with elements that replace the content ofvalue. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for value- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableImageResourcethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:path,value.
-
toString
public String toString()
Prints the immutable valueImageResourcewith attribute values.
-
copyOf
public static ImmutableImageResource copyOf(StaticContentClient.ImageResource instance)
Creates an immutable copy of aStaticContentClient.ImageResourcevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ImageResource instance
-
builder
public static ImmutableImageResource.Builder builder()
Creates a builder forImmutableImageResource.ImmutableImageResource.builder() .path(String) // requiredpath.value(byte) // requiredvalue.build();- Returns:
- A new ImmutableImageResource builder
-
-