// Path: src/main/java/com/github/easyjsonapi/asserts/Assert.java
// public class Assert {
// 
//     /**
//      * Check if string is null or empty
//      * 
//      * @param value the string value
//      * @return true if string is null or empty and false when occur the opposite
//      */
//     public static boolean isEmpty(String value) {
// 
//         if (value != null && !value.isEmpty()) {
//             return false;
//         }
//         return true;
//     }
// 
//     /**
//      * Check if object is null
//      * 
//      * @param value the object value
//      * @return true if object is null and false when occur the opposite
//      */
//     public static boolean isNull(Object value) {
//         if (value == null) {
//             return true;
//         }
// 
//         return false;
//     }
// 
//     /**
//      * Check if list of objects are null
//      * 
//      * @param values the list with objects
//      * @return true if list with objects are null and false when occur the
//      *         opposite
//      */
//     public static boolean isNull(Object... values) {
// 
//         boolean anyNotNullable = false;
// 
//         int index = 0;
// 
//         while (index < values.length && !anyNotNullable) {
//             if (notNull(values[index])) {
//                 anyNotNullable = true;
//             }
//             index++;
//         }
// 
//         return !anyNotNullable;
//     }
// 
//     /**
//      * Check if string is not null or empty
//      * 
//      * @param value the string value
//      * @return true if string has value and false when string is null or empty
//      */
//     public static boolean notEmpty(String value) {
//         return !isEmpty(value);
//     }
// 
//     /**
//      * Check if object is null
//      * 
//      * @param value the object value
//      * @return true if object has value and false when object is null
//      */
//     public static boolean notNull(Object value) {
//         return !isNull(value);
//     }
// 
// }
// 
// Path: src/main/java/com/github/easyjsonapi/asserts/Validation.java
// public class Validation {
// 
//     /**
//      * Check if object is valid. One object is valid when has one of the rules
//      * below:
//      *
//      * - is an instance of {@link Map}
//      * - has the annotation {@link Attributes}
//      * - has the annotation {@link Meta}
//      * 
//      * @param objectAnnotated
//      *            the object needs validate
//      */
//     public static void checkValidObject(Object objectAnnotated) {
// 
//         boolean notAnnotated = true;
// 
//         if (Assert.isNull(objectAnnotated)) {
//             notAnnotated = false;
//         } else if (objectAnnotated instanceof Map) {
//             notAnnotated = false;
//         } else if (Assert.notNull(objectAnnotated.getClass().getAnnotation(Attributes.class))) {
//             notAnnotated = false;
//         } else if (Assert.notNull(objectAnnotated.getClass().getAnnotation(Meta.class))) {
//             notAnnotated = false;
//         } else if (Assert.notNull(objectAnnotated.getClass().getAnnotation(MetaRelationship.class))) {
//             notAnnotated = false;
//         }
// 
//         if (notAnnotated) {
//             throw new EasyJsonApiEntityException("Invalid object inserted! Please check the annotation inside the pojo!");
//         }
// 
//     }
// 
// }


import com.github.easyjsonapi.asserts.Assert;
import com.github.easyjsonapi.asserts.Validation;
import com.google.gson.annotations.SerializedName;
/*
 * #%L
 * EasyJsonApi
 * %%
 * Copyright (C) 2016 EasyJsonApi
 * %%
 * 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://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.
 * #L%
 */
package com.github.easyjsonapi.entities;


/**
 * Entity represents data resource object in json api specification
 * 
 * @author Nuno Bento (nbento.neves@gmail.com)
 * @see {@link JsonApi}
 * @see {@link Relationships}
 */
public final class Data implements Cloneable {

    @SerializedName(value = "attributes")
    private final Object attr;

    @SerializedName(value = "id")
    private final String id;

    // @SerializedName(value = "links")
    // private final Object links;

    @SerializedName(value = "relationships")
    private Relationships rels;

    @SerializedName(value = "type")
    private final String type;

    public Data(String id, String type, Object attr) {
// Path: src/main/java/com/github/easyjsonapi/asserts/Assert.java
// public class Assert {
// 
//     /**
//      * Check if string is null or empty
//      * 
//      * @param value the string value
//      * @return true if string is null or empty and false when occur the opposite
//      */
//     public static boolean isEmpty(String value) {
// 
//         if (value != null && !value.isEmpty()) {
//             return false;
//         }
//         return true;
//     }
// 
//     /**
//      * Check if object is null
//      * 
//      * @param value the object value
//      * @return true if object is null and false when occur the opposite
//      */
//     public static boolean isNull(Object value) {
//         if (value == null) {
//             return true;
//         }
// 
//         return false;
//     }
// 
//     /**
//      * Check if list of objects are null
//      * 
//      * @param values the list with objects
//      * @return true if list with objects are null and false when occur the
//      *         opposite
//      */
//     public static boolean isNull(Object... values) {
// 
//         boolean anyNotNullable = false;
// 
//         int index = 0;
// 
//         while (index < values.length && !anyNotNullable) {
//             if (notNull(values[index])) {
//                 anyNotNullable = true;
//             }
//             index++;
//         }
// 
//         return !anyNotNullable;
//     }
// 
//     /**
//      * Check if string is not null or empty
//      * 
//      * @param value the string value
//      * @return true if string has value and false when string is null or empty
//      */
//     public static boolean notEmpty(String value) {
//         return !isEmpty(value);
//     }
// 
//     /**
//      * Check if object is null
//      * 
//      * @param value the object value
//      * @return true if object has value and false when object is null
//      */
//     public static boolean notNull(Object value) {
//         return !isNull(value);
//     }
// 
// }
// 
// Path: src/main/java/com/github/easyjsonapi/asserts/Validation.java
// public class Validation {
// 
//     /**
//      * Check if object is valid. One object is valid when has one of the rules
//      * below:
//      *
//      * - is an instance of {@link Map}
//      * - has the annotation {@link Attributes}
//      * - has the annotation {@link Meta}
//      * 
//      * @param objectAnnotated
//      *            the object needs validate
//      */
//     public static void checkValidObject(Object objectAnnotated) {
// 
//         boolean notAnnotated = true;
// 
//         if (Assert.isNull(objectAnnotated)) {
//             notAnnotated = false;
//         } else if (objectAnnotated instanceof Map) {
//             notAnnotated = false;
//         } else if (Assert.notNull(objectAnnotated.getClass().getAnnotation(Attributes.class))) {
//             notAnnotated = false;
//         } else if (Assert.notNull(objectAnnotated.getClass().getAnnotation(Meta.class))) {
//             notAnnotated = false;
//         } else if (Assert.notNull(objectAnnotated.getClass().getAnnotation(MetaRelationship.class))) {
//             notAnnotated = false;
//         }
// 
//         if (notAnnotated) {
//             throw new EasyJsonApiEntityException("Invalid object inserted! Please check the annotation inside the pojo!");
//         }
// 
//     }
// 
// }


// Path: src/main/java/com/github/easyjsonapi/entities/Data.java
import com.github.easyjsonapi.asserts.Assert;
import com.github.easyjsonapi.asserts.Validation;
import com.google.gson.annotations.SerializedName;

/*
 * #%L
 * EasyJsonApi
 * %%
 * Copyright (C) 2016 EasyJsonApi
 * %%
 * 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://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.
 * #L%
 */
package com.github.easyjsonapi.entities;


/**
 * Entity represents data resource object in json api specification
 * 
 * @author Nuno Bento (nbento.neves@gmail.com)
 * @see {@link JsonApi}
 * @see {@link Relationships}
 */
public final class Data implements Cloneable {

    @SerializedName(value = "attributes")
    private final Object attr;

    @SerializedName(value = "id")
    private final String id;

    // @SerializedName(value = "links")
    // private final Object links;

    @SerializedName(value = "relationships")
    private Relationships rels;

    @SerializedName(value = "type")
    private final String type;

    public Data(String id, String type, Object attr) {
        Validation.checkValidObject(attr);