// Path: api/src/main/java/com/jfrog/bintray/client/api/ObjectMapperHelper.java
// public class ObjectMapperHelper {
// 
//     public static ObjectMapper get() {
//         return buildDetailsMapper();
//     }
// 
//     private static ObjectMapper buildDetailsMapper() {
//         ObjectMapper mapper = new ObjectMapper(new JsonFactory());
// 
//         // TODO: when moving to Jackson 2.x these can be replaced with JodaModule
//         mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false);
// 
//         //Don't include keys with null values implicitly, only explicitly set values should be sent over
//         mapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
//         mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
//         return mapper;
//     }
// }


import com.jfrog.bintray.client.api.ObjectMapperHelper;
import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import static java.util.Arrays.asList;
package com.jfrog.bintray.client.api.details;





/**
 * This class represents an attribute (version or package)
 * NOTE: when serializing this class use getObjectMapper to obtain a suitable mapper for this class
 *
 * @author Dan Feldman
 */
@JsonPropertyOrder({"name", "values", "type"})
@JsonIgnoreProperties(ignoreUnknown = true)
public class Attribute<T> {
    private static final Logger log = LoggerFactory.getLogger(Attribute.class);
    @JsonProperty("name")
    private String name;
    @JsonProperty("values")
    private List<T> values;
    @JsonProperty("type")
    private Type type;

    @SafeVarargs
    public Attribute(String name, T... values) {
        this(name, null, asList(values));
    }


    @SafeVarargs
    public Attribute(String name, Type type, T... values) {
        this(name, type, asList(values));
    }

    @JsonCreator
    public Attribute(@JsonProperty("name") String name, @JsonProperty("type") Type type, @JsonProperty("values") List<T> values) {
        this.name = name;
        if (type == null) {
            type = Type.string;     //Type defaults to string
        }
        this.type = type;
        this.values = values;
    }

    public static ObjectMapper getObjectMapper() {
// Path: api/src/main/java/com/jfrog/bintray/client/api/ObjectMapperHelper.java
// public class ObjectMapperHelper {
// 
//     public static ObjectMapper get() {
//         return buildDetailsMapper();
//     }
// 
//     private static ObjectMapper buildDetailsMapper() {
//         ObjectMapper mapper = new ObjectMapper(new JsonFactory());
// 
//         // TODO: when moving to Jackson 2.x these can be replaced with JodaModule
//         mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false);
// 
//         //Don't include keys with null values implicitly, only explicitly set values should be sent over
//         mapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
//         mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
//         return mapper;
//     }
// }


// Path: api/src/main/java/com/jfrog/bintray/client/api/details/Attribute.java
import com.jfrog.bintray.client.api.ObjectMapperHelper;
import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import static java.util.Arrays.asList;

package com.jfrog.bintray.client.api.details;





/**
 * This class represents an attribute (version or package)
 * NOTE: when serializing this class use getObjectMapper to obtain a suitable mapper for this class
 *
 * @author Dan Feldman
 */
@JsonPropertyOrder({"name", "values", "type"})
@JsonIgnoreProperties(ignoreUnknown = true)
public class Attribute<T> {
    private static final Logger log = LoggerFactory.getLogger(Attribute.class);
    @JsonProperty("name")
    private String name;
    @JsonProperty("values")
    private List<T> values;
    @JsonProperty("type")
    private Type type;

    @SafeVarargs
    public Attribute(String name, T... values) {
        this(name, null, asList(values));
    }


    @SafeVarargs
    public Attribute(String name, Type type, T... values) {
        this(name, type, asList(values));
    }

    @JsonCreator
    public Attribute(@JsonProperty("name") String name, @JsonProperty("type") Type type, @JsonProperty("values") List<T> values) {
        this.name = name;
        if (type == null) {
            type = Type.string;     //Type defaults to string
        }
        this.type = type;
        this.values = values;
    }

    public static ObjectMapper getObjectMapper() {
        return ObjectMapperHelper.get();