class UserImage extends Object
Value
for the "/user/EMAIL/-/image" Key
. Illustrates the use of
a single-attribute Key/Value pair.
Because the image is expected to be large and is not accessed along
with other attributes, it is stored separately from the
multi-attribute UserInfo
Key/Value pair.
Constructor and Description |
---|
UserImage(String email)
Constructs a user object with its unique identifier, the email address.
|
Modifier and Type | Method and Description |
---|---|
(package private) String |
getEmail()
Returns the email identifier.
|
(package private) byte[] |
getImage()
Returns the image bytes.
|
(package private) Key |
getStoreKey()
Returns a Key that can be used to write or read the UserImage.
|
(package private) Value |
getStoreValue(Bindings bindings)
Deserializes the image into the byte array of a Value.
|
(package private) void |
setImage(byte[] image)
Changes the image bytes.
|
(package private) void |
setStoreValue(Bindings bindings,
Value value)
Deserializes the image from the byte array of a Value.
|
String |
toString() |
UserImage(String email)
String getEmail()
void setImage(byte[] image)
byte[] getImage()
Key getStoreKey()
Value getStoreValue(Bindings bindings)
Note that since there is only one field, a byte array, the Value's byte array could be stored directly. But using an Avro binding allows for the possibility of adding additional fields in the future.
void setStoreValue(Bindings bindings, Value value)
Note that since there is only one field, a byte array, the Value's byte array could be stored directly. But using an Avro binding allows for the possibility of adding additional fields in the future.
Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.