コード例 #1
0
 /**
  * Deserializes a NIS boot info.
  *
  * @param deserializer The deserializer.
  */
 public NisBootInfo(final Deserializer deserializer) {
   // To provide a smooth transition from old structure
   final Integer bootStrategy = deserializer.readOptionalInt("bootNis");
   this.bootStrategy = null == bootStrategy ? 0 : bootStrategy;
   this.accountId = deserializer.readOptionalString("account");
   this.nodeName = deserializer.readOptionalString("nodeName");
 }
コード例 #2
0
  /**
   * Sets the fields based on deserializer.
   *
   * @param deserializer The deserializer.
   */
  public void deserialize(final Deserializer deserializer, final boolean remoteIsOptional) {
    this.setLanguage(deserializer.readString("language"));
    if (remoteIsOptional) {
      this.setNisEndpoint(deserializer.readOptionalObject("remoteServer", NodeEndpoint::new));
    } else {
      this.setNisEndpoint(deserializer.readObject("remoteServer", NodeEndpoint::new));
    }
    this.setNisBootInfo(deserializer.readObject("nisBootInfo", NisBootInfo::new));

    this.setFirstStart(deserializer.readOptionalInt("firstStart"));
  }