if (type != INVOCATION_POLICY_TYPE.value) {
throw new PolicyError("Invalid InvocationPolicyType", (short) 0);
}
short policyValue = InvocationPolicyValueHelper.extract(value);
switch (policyValue) {
case SHARED.value :
case UNSHARED.value :
case EITHER.value :
break;
default :
throw new PolicyError("Invalid InvocationPolicyValue", (short) 1);
}
return new InvocationPolicyImpl(policyValue);