@SuppressWarnings("unchecked") private void unmarshal(Map<String,Object> json,Connection conn){
  if (json.containsKey("agreement")) {
    try {
      this.agreement=new URI((String)json.get("agreement"));
    }
 catch (    ClassCastException|URISyntaxException ex) {
      throw new AcmeProtocolException("Illegal agreement URI",ex);
    }
  }
  if (json.containsKey("contact")) {
    contacts.clear();
    for (    Object c : (Collection<Object>)json.get("contact")) {
      try {
        contacts.add(new URI((String)c));
      }
 catch (      ClassCastException|URISyntaxException ex) {
        throw new AcmeProtocolException("Illegal contact URI",ex);
      }
    }
  }
  if (json.containsKey("authorizations")) {
    try {
      this.authorizations=new URI((String)json.get("authorizations"));
    }
 catch (    ClassCastException|URISyntaxException ex) {
      throw new AcmeProtocolException("Illegal authorizations URI",ex);
    }
  }
 else {
    this.authorizations=null;
  }
  if (json.containsKey("certificates")) {
    try {
      this.certificates=new URI((String)json.get("certificates"));
    }
 catch (    ClassCastException|URISyntaxException ex) {
      throw new AcmeProtocolException("Illegal certificates URI",ex);
    }
  }
 else {
    this.certificates=null;
  }
  if (json.containsKey("status")) {
    this.status=Status.parse((String)json.get("status"));
  }
  URI location=conn.getLocation();
  if (location != null) {
    setLocation(location);
  }
  URI tos=conn.getLink("terms-of-service");
  if (tos != null) {
    this.agreement=tos;
  }
  loaded=true;
}

@ SuppressWarnings ( "unchecked" ) private void unmarshal ( Map < String , Object > json , Connection conn ) { if ( json . containsKey ( "agreement" ) ) { try { this . agreement = new URI ( ( String ) json . get ( "agreement" ) ) ; } catch ( ClassCastException | URISyntaxException ex ) { throw new AcmeProtocolException ( "Illegal agreement URI" , ex ) ; } } if ( json . containsKey ( "contact" ) ) { contacts . clear ( ) ; for ( Object c : ( Collection < Object > ) json . get ( "contact" ) ) { try { contacts . add ( new URI ( ( String ) c ) ) ; } catch ( ClassCastException | URISyntaxException ex ) { throw new AcmeProtocolException ( "Illegal contact URI" , ex ) ; } } } if ( json . containsKey ( "authorizations" ) ) { try { this . authorizations = new URI ( ( String ) json . get ( "authorizations" ) ) ; } catch ( ClassCastException | URISyntaxException ex ) { throw new AcmeProtocolException ( "Illegal authorizations URI" , ex ) ; } } else { this . authorizations = null ; } if ( json . containsKey ( "certificates" ) ) { try { this . certificates = new URI ( ( String ) json . get ( "certificates" ) ) ; } catch ( ClassCastException | URISyntaxException ex ) { throw new AcmeProtocolException ( "Illegal certificates URI" , ex ) ; } } else { this . certificates = null ; } if ( json . containsKey ( "status" ) ) { this . status = Status . parse ( ( String ) json . get ( "status" ) ) ; } URI location = conn . getLocation ( ) ; if ( location != null ) { setLocation ( location ) ; } URI tos = conn . getLink ( "terms-of-service" ) ; if ( tos != null ) { this . agreement = tos ; } loaded = true ; }
sets registration properties according to the given json data .
