/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://aws.amazon.com/apache2.0 * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and * limitations under the License. */ package com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper; import java.nio.ByteBuffer; @DynamoDBDocument public class SubClass { private String name; private Integer value; private ByteBuffer bb; public SubClass() { name = "name"; value = 123; } public String getName() { return name; } public void setName(String n) { name = n; } public Integer getValue() { return value; } public void setValue(Integer i) { value = i; } public ByteBuffer getNull() { return bb; } public void setNull(ByteBuffer b) { bb = b; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SubClass)) { return false; } SubClass that = (SubClass) o; return equals(this.name, that.name) && equals(this.value, that.value) && equals(this.bb, that.bb); } @Override public String toString() { return "{name=" + name + ", value=" + value + ", bb=" + bb + "}"; } public static <T> boolean equals(T one, T two) { if (one == null) { return (two == null); } else { return one.equals(two); } } }