Example usage for com.amazonaws.services.dynamodbv2.model AttributeValue isBOOL

List of usage examples for com.amazonaws.services.dynamodbv2.model AttributeValue isBOOL

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model AttributeValue isBOOL.

Prototype


public Boolean isBOOL() 

Source Link

Document

An attribute of type Boolean.

Usage

From source file:org.xmlsh.aws.util.AWSDDBCommand.java

License:BSD License

protected void writeAttributeValue(AttributeValue avalue) throws XMLStreamException, IOException {
    if (avalue.getS() != null) {
        attribute(AttrType.S);//from  w  ww.  j a va  2s  .  c  o m
        characters(avalue.getS());
    } else if (avalue.getN() != null) {
        attribute(AttrType.N);
        characters(avalue.getN());
    } else

    if (avalue.getB() != null) {
        attribute(AttrType.B);
        binary(avalue.getB().array());
    } else if (avalue.getSS() != null) {
        attribute(AttrType.SS);

        for (String s : avalue.getSS()) {
            startElement("value");
            characters(s);
            endElement();
        }

    } else if (avalue.getNS() != null) {
        attribute(AttrType.NS);

        for (String s : avalue.getNS()) {
            startElement("value");
            characters(s);
            endElement();
        }
    } else if (avalue.getBS() != null) {
        attribute(AttrType.BS);

        for (ByteBuffer s : avalue.getBS()) {
            startElement("value");
            binary(s.array());
            endElement();
        }
    } else if (avalue.getL() != null) {
        attribute(AttrType.L);
        for (AttributeValue av : avalue.getL()) {
            startElement("value");
            writeAttributeValue(av);
            endElement();
        }
    } else if (avalue.getM() != null) {
        attribute(AttrType.M);
        for (Entry<String, AttributeValue> e : avalue.getM().entrySet()) {
            writeAttribute(e.getKey(), e.getValue());
        }
    } else if (avalue.isBOOL() != null) {
        attribute(AttrType.BOOL);
        characters(avalue.getBOOL().booleanValue() ? "true" : "false");
    } else if (avalue.isNULL() != null) {
        attribute(AttrType.NULL);
        characters(avalue.getNULL().booleanValue() ? "true" : "false");
    }

}