if (type != OTS_POLICY_TYPE.value) {
throw new PolicyError("Invalid OTSPolicyType", (short) 0);
}
short policyValue = OTSPolicyValueHelper.extract(value);
switch (policyValue) {
case REQUIRES.value :
case ADAPTS.value :
case FORBIDS.value :
break;
default :
throw new PolicyError("Invalid OTSPolicyValue", (short) 1);
}
return new OTSPolicyImpl(policyValue);