io.contek.zeus.ServerOrderLabel Maven / Gradle / Ivy
package io.contek.zeus;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@Immutable
public final class ServerOrderLabel extends StringKey {
private ServerOrderLabel(String stringValue) {
super(stringValue);
}
public static ServerOrderLabel of(int longValue) {
return of(Integer.toString(longValue));
}
public static ServerOrderLabel of(long longValue) {
return of(Long.toString(longValue));
}
public static ServerOrderLabel of(String stringValue) {
ServerOrderLabel result = ofNullable(stringValue);
if (result == null) {
throw new IllegalArgumentException(stringValue);
}
return result;
}
@Nullable
public static ServerOrderLabel ofNullable(@Nullable String stringValue) {
if (stringValue == null || stringValue.isEmpty()) {
return null;
}
return new ServerOrderLabel(stringValue);
}
}