Package io.micronaut.http.hateoas
Class GenericResource
- java.lang.Object
-
- io.micronaut.http.hateoas.AbstractResource<GenericResource>
-
- io.micronaut.http.hateoas.GenericResource
-
- All Implemented Interfaces:
Resource
@Introspected public final class GenericResource extends AbstractResource<GenericResource>
Resource
with indeterminate structure. This is used as the deserialization target ofResource.getEmbedded()
, because we can't determine the type of the resource for deserialization, there.- Since:
- 3.4.0
-
-
Constructor Summary
Constructors Constructor Description GenericResource()
Create a new resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(java.lang.String key, java.lang.Object v)
Add a property to this resource (internal, for deserialization use only).boolean
equals(java.lang.Object o)
java.util.Map<java.lang.String,java.lang.Object>
getAdditionalProperties()
Get the properties of this resource, as an untyped map.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class io.micronaut.http.hateoas.AbstractResource
embedded, embedded, embedded, getEmbedded, getLinks, link, link, setEmbedded, setLinks
-
-
-
-
Constructor Detail
-
GenericResource
@Internal public GenericResource()
Create a new resource. Note: Should only be called by deserialization – if you wish to create your ownResource
, please create a custom implementation ofAbstractResource
.
-
-
Method Detail
-
addProperty
@Internal public void addProperty(java.lang.String key, java.lang.Object v)
Add a property to this resource (internal, for deserialization use only).- Parameters:
key
- Property keyv
- Property value
-
getAdditionalProperties
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalProperties()
Get the properties of this resource, as an untyped map.- Returns:
- The properties of this resource
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-