Package org.xbill.DNS.utils.json.resourcerecords

Source Code of org.xbill.DNS.utils.json.resourcerecords.SRVRecordDeserializer

package org.xbill.DNS.utils.json.resourcerecords;

import com.fasterxml.jackson.databind.node.ObjectNode;
import org.xbill.DNS.Name;
import org.xbill.DNS.SRVRecord;

/**
* Jackson deserializer for the {@link org.xbill.DNS.SRVRecord} class
* @author Arnaud Dumont
*/
public class SRVRecordDeserializer extends
    AbstractRecordDeserializer<SRVRecord> {
  private static final long serialVersionUID = -6051918053495550554L;

  public SRVRecordDeserializer() {
    super(SRVRecord.class);
  }

  @Override
  protected SRVRecord createRecord(final Name name, final int dclass,
      final long ttl, final ObjectNode recordNode) {
    return new SRVRecord(name, dclass, ttl, getNodeIntegerValue(recordNode,
        "priority"), getNodeIntegerValue(recordNode, "weight"),
        getNodeIntegerValue(recordNode, "port"), getNodeNameValue(
            recordNode, "target"));
  }

  @Override
  protected String getTextualRecordType() {
    return "SRV";
  }
}
TOP

Related Classes of org.xbill.DNS.utils.json.resourcerecords.SRVRecordDeserializer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.