001 002/* 003 * Copyright (C) 2010 Archie L. Cobbs. All rights reserved. 004 * 005 * $Id$ 006 */ 007 008package org.dellroad.jibxbindings.pidf; 009 010import java.net.URI; 011import java.util.Date; 012 013import org.dellroad.jibxbindings.pidf.lo.GeoPriv; 014 015/** 016 * The {@code <dm:device>} element as defined in RFC 4479. 017 * 018 * @see <a href="http://tools.ietf.org/html/rfc4479">RFC 4479</a> 019 */ 020public class Device implements Component { 021 022 private String id; 023 private GeoPriv geoPriv; 024 private URI deviceID; 025 private LangContent note; 026 private Date timestamp; 027 028 public String getId() { 029 return this.id; 030 } 031 public void setId(String id) { 032 this.id = id; 033 } 034 035 @Override 036 public GeoPriv getGeoPriv() { 037 return this.geoPriv; 038 } 039 public void setGeoPriv(GeoPriv geoPriv) { 040 this.geoPriv = geoPriv; 041 } 042 043 public URI getDeviceID() { 044 return this.deviceID; 045 } 046 public void setDeviceID(URI deviceID) { 047 this.deviceID = deviceID; 048 } 049 050 public LangContent getNote() { 051 return this.note; 052 } 053 public void setNote(LangContent note) { 054 this.note = note; 055 } 056 057 public Date getTimestamp() { 058 return this.timestamp; 059 } 060 public void setTimestamp(Date timestamp) { 061 this.timestamp = timestamp; 062 } 063 064 @Override 065 public void visit(ComponentSwitch componentSwitch) { 066 componentSwitch.caseDevice(this); 067 } 068 069// Cloneable 070 071 @Override 072 public Device clone() { 073 final Device clone; 074 try { 075 clone = (Device)super.clone(); 076 } catch (CloneNotSupportedException e) { 077 throw new RuntimeException(e); 078 } 079 clone.geoPriv = this.geoPriv != null ? this.geoPriv.clone() : null; 080 clone.note = this.note != null ? this.note.clone() : null; 081 return clone; 082 } 083} 084