Enum for Range Interval options

Enum with the options for rangeInterval listed in the TMF ServiceSpecCharacteristicValue, similar to other Enums in the same folder.

It is helpful for implementing the new range interval feature in org.etsi.osl.tmf.api (epic).

Closes #29 (closed)

Edited by Kostis Trantzas

Merge request reports

Loading
+27
Changes for src/main/java/org/etsi/osl/tmf/common/model/ERangeInterval.java: 27 added lines, 0 removed lines.
Original line number Diff line number Diff line
package org.etsi.osl.tmf.common.model;

public enum ERangeInterval {
    OPEN("open"),
    CLOSED("closed"),
    CLOSED_BOTTOM("closedBottom"),
    CLOSED_TOP("closedTop");

    private String value;

    ERangeInterval(String value) {this.value = value;}

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return this.getValue();
    }

    public static ERangeInterval getEnum(String value) {
        for(ERangeInterval v : values())
            if(v.getValue().equalsIgnoreCase(value)) return v;
        throw new IllegalArgumentException();
    }
}
Loading