code: public static final Controller.RetentionPolicy decode(final RetentionPolicy policyModel) {
          if (policyModel != null) {
              return Controller.RetentionPolicy.newBuilder()
                      .setRetentionType(Controller.RetentionPolicy.RetentionPolicyType.valueOf(policyModel.getRetentionType().name()))
                      .setRetentionParam(policyModel.getRetentionParam())
                      .build();
          } else {
              return null;
          }
      }
docs: Decodes RetentionPolicy and returns an instance of Retention Policy impl.
  
  @param policyModel The Retention Policy.
  @return Instance of Retention Policy Impl.