/** * a key can have several values per version. a null version represents the default while other are specific one: * key.value = someval // the default value. the path returned is "value" key.value.3.1 = otherval // the 3.1 * version val. the path returned is "value.3.1" * * @return the string representation of the value path. for key.value.3.1 = otherval "value.3.1" should be returned. */ private String versionedValuePath(Version version) { return version == null ? "value" : "value." + version.toString(); }
@Override public Version getCompatibilityVersion() { return Version.getLast(); } }
/** * @return true if this instance version is less or equals to candidate */ public boolean lessOrEquals(Version candidate) { return this.compareTo(candidate) <= 0; }
/** * Used by REST because AbstractBackendResource has id member * that is always assumed to be Guid */ public StorageServerConnectionQueryParametersBase(Guid serverConnectionId) { this(serverConnectionId.toString()); }
public Permission(Guid adElementId, Guid roleId, Guid objectId, VdcObjectType objectType) { this.id = Guid.newGuid(); this.adElementId = adElementId; this.roleId = roleId; this.objectId = objectId; this.objectType = objectType; }
private static Guid createGuidFromStringWithDefault(String candidate, Guid defaultValue) { if (candidate == null) { return defaultValue; } return new Guid(candidate); }
public OS() { name = ""; version = new Version(); fullVersion = ""; }
@Override public Object getQueryableId() { return StringFormat.format("%1$s%2$s%3$s%4$s", id.eventUpName, id.eventNotificationMethod, id.subscriberId, id.tagName == null ? "" : id.tagName); } }
public static TimeSpan tryParse(String string) { try { return TimeSpan.parse(string); } catch (IllegalArgumentException e) { // eat it, return null return null; } }
public static Source getUrandomOrRandomFor(Version version) { if (version.greaterOrEquals(FIRST_URANDOM_VERSION)) { return URANDOM; } return RANDOM; }
public TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds) { TotalMilliseconds = milliseconds; TotalMilliseconds += seconds * MS_PER_SECOND; TotalMilliseconds += (long)minutes * (long)MS_PER_MINUTE; TotalMilliseconds += (long)hours * (long)MS_PER_HOUR; TotalMilliseconds += (long)days * (long)MS_PER_DAY; computeProperties(); }
private String guidToStringNullSafe(Guid id) { return (id == null) ? null : id.toString(); }
public Guid getId(boolean generateIfNull) { if(id == null && generateIfNull) { id = Guid.newGuid(); } return id; }
public Version getCompatibilityVersion() { if (version == null) { version = new Version(compatibilityVersion); } return version; }
protected Version latestCluster() { // instance type and blank template always exposes all the features of the latest cluster and if some is not applicable // than that particular feature will not be applicable on the instance creation return Version.getLast(); }
/** * @return true if this instance version is greater or equals candidate */ public boolean greaterOrEquals(Version candidate) { return this.compareTo(candidate) >= 0; }
/** * @return true if this instance version is greater than candidate */ public boolean greater(Version candidate) { return this.compareTo(candidate) > 0; }