Oracle NoSQL Database Examples
version 11gR2.2.0.26

schema
Class UserImage

java.lang.Object
  extended by schema.UserImage

 class UserImage
extends Object

Holds the image user attribute that is stored as the 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 Summary
UserImage(String email)
          Constructs a user object with its unique identifier, the email address.
 
Method Summary
(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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserImage

UserImage(String email)
Constructs a user object with its unique identifier, the email address.

Method Detail

getEmail

String getEmail()
Returns the email identifier.


setImage

void setImage(byte[] image)
Changes the image bytes.


getImage

byte[] getImage()
Returns the image bytes.


getStoreKey

Key getStoreKey()
Returns a Key that can be used to write or read the UserImage.


getStoreValue

Value getStoreValue(Bindings bindings)
Deserializes the image into the byte array of a 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.


setStoreValue

void setStoreValue(Bindings bindings,
                   Value value)
Deserializes the image from the byte array of a 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.


toString

public String toString()
Overrides:
toString in class Object

Oracle NoSQL Database Examples
version 11gR2.2.0.26

Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved.