public class StringConverter extends Converter<String>
Converter.ContentAndType, Converter.OrmExtracted
Constructor and Description |
---|
StringConverter() |
Modifier and Type | Method and Description |
---|---|
Converter.ContentAndType |
fromDomain(String domainObject)
Provide the value portion of a RiakObject from the domain object.
|
Converter.OrmExtracted |
fromDomain(String domainObject,
Namespace namespace,
BinaryValue key)
Convert from a domain object to a RiakObject.
|
String |
toDomain(BinaryValue value,
String contentType)
Convert the value portion of a RiakObject to a domain object.
|
String |
toDomain(RiakObject obj,
Location location)
Converts from a RiakObject to a domain object.
|
newDomainInstance
public String toDomain(RiakObject obj, Location location)
Converter
public Converter.OrmExtracted fromDomain(String domainObject, Namespace namespace, BinaryValue key)
Converter
The domain object itself may be completely annotated with everything
required to produce a RiakObject except for the value portion.
This will prefer annotated
items over the Location
passed in.
fromDomain
in class Converter<String>
domainObject
- a domain object to be stored in Riak.namespace
- the namespace in Riakkey
- the key for the objectpublic String toDomain(BinaryValue value, String contentType) throws ConversionException
Converter
Implementations override this method to convert the value contained in
a RiakObject
to an instance of a domain object.
toDomain
in class Converter<String>
value
- the value portion of a RiakObject to convert to a domain objectcontentType
- The content type of the RiakObjectConversionException
public Converter.ContentAndType fromDomain(String domainObject) throws ConversionException
Converter
Implementations override this method to provide the value portion of the RiakObject to be stored from the supplied domain object.
fromDomain
in class Converter<String>
domainObject
- the domain object.ConversionException
Copyright © 2016. All rights reserved.