All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jgcomptech.tools.enums.ProductType Maven / Gradle / Ivy

package com.jgcomptech.tools.enums;

import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * A list of Product Types according to
 * Microsoft Documentation.
 */
public enum ProductType implements BaseEnum {
    /** Unknown OS. */
    Unknown(0),
    /** Workstation. */
    NTWorkstation(1),
    /** Domain Controller. */
    NTDomainController(2),
    /** Server. */
    NTServer(3);

    private final int value;

    ProductType(final int value) {
        this.value = value;
    }

    public static ProductType parse(final int value) {
        for(final ProductType type : ProductType.values()) {
            if(type.getValue() == value) {
                return type;
            }
        }
        return null;
    }

    @Override
    public int getValue() { return value; }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("value", value)
                .toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy