// Path: src/main/java/com/papercut/dust/model/Validations.java
// public class Validations {
// 
//     /**
//      * Validation group used when creating a device.
//      */
//     public interface Create {
//     }
// 
//     /**
//      * Validation group used when updating a device.
//      */
//     public interface Update {
//     }
// }
// 
// Path: src/main/java/com/papercut/dust/model/Identifiable.java
// public interface Identifiable<T> {
// 
//     Long getId();
// 
//     T withId(long newId);
// 
// }


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.papercut.dust.model.Validations;
import com.papercut.dust.model.Identifiable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
/*
 * Copyright (c) 2017 PaperCut Software International Pty. Ltd.
 *
 * https://www.papercut.com
 *
 * Use of this source code is governed by an MIT license.
 * See the project's LICENSE file for more information.
 */
package com.papercut.dust.device;



@JsonIgnoreProperties(ignoreUnknown = true)
public class Device implements Identifiable<Device>, Serializable {

    @JsonProperty
    @Null(groups = Validations.Create.class)
    @NotNull(groups = Validations.Update.class)
    final Long id;

    @NotNull
    @Size(min = 2, max = 50)
    @JsonProperty
    final String brand;

    @NotNull
    @Size(min = 2, max = 50)
    @JsonProperty
    final String model;

    @Size(min = 2, max = 50)
    @JsonProperty
    final String hostname;

    @NotNull
    @Size(min = 2, max = 20)
    @JsonProperty
    final String nickname;

    @NotNull
    @Size(min = 2, max = 15)
// Path: src/main/java/com/papercut/dust/model/Validations.java
// public class Validations {
// 
//     /**
//      * Validation group used when creating a device.
//      */
//     public interface Create {
//     }
// 
//     /**
//      * Validation group used when updating a device.
//      */
//     public interface Update {
//     }
// }
// 
// Path: src/main/java/com/papercut/dust/model/Identifiable.java
// public interface Identifiable<T> {
// 
//     Long getId();
// 
//     T withId(long newId);
// 
// }


// Path: src/main/java/com/papercut/dust/device/Device.java
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.papercut.dust.model.Validations;
import com.papercut.dust.model.Identifiable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;

/*
 * Copyright (c) 2017 PaperCut Software International Pty. Ltd.
 *
 * https://www.papercut.com
 *
 * Use of this source code is governed by an MIT license.
 * See the project's LICENSE file for more information.
 */
package com.papercut.dust.device;



@JsonIgnoreProperties(ignoreUnknown = true)
public class Device implements Identifiable<Device>, Serializable {

    @JsonProperty
    @Null(groups = Validations.Create.class)
    @NotNull(groups = Validations.Update.class)
    final Long id;

    @NotNull
    @Size(min = 2, max = 50)
    @JsonProperty
    final String brand;

    @NotNull
    @Size(min = 2, max = 50)
    @JsonProperty
    final String model;

    @Size(min = 2, max = 50)
    @JsonProperty
    final String hostname;

    @NotNull
    @Size(min = 2, max = 20)
    @JsonProperty
    final String nickname;

    @NotNull
    @Size(min = 2, max = 15)
    @JsonProperty