/java/src/com/google/gdata/data/contacts/DirectoryServer.java

http://gdata-java-client.googlecode.com/ · Java · 76 lines · 29 code · 11 blank · 36 comment · 0 complexity · 8ff13bd49ac13e49608b767b27f30a74 MD5 · raw file

  1. /* Copyright (c) 2008 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. package com.google.gdata.data.contacts;
  16. import com.google.gdata.data.ExtensionDescription;
  17. import com.google.gdata.data.ValueConstruct;
  18. /**
  19. * Contact's directory server.
  20. *
  21. *
  22. */
  23. @ExtensionDescription.Default(
  24. nsAlias = ContactsNamespace.GCONTACT_ALIAS,
  25. nsUri = ContactsNamespace.GCONTACT,
  26. localName = DirectoryServer.XML_NAME)
  27. public class DirectoryServer extends ValueConstruct {
  28. /** XML element name */
  29. static final String XML_NAME = "directoryServer";
  30. /**
  31. * Default mutable constructor.
  32. */
  33. public DirectoryServer() {
  34. this(null);
  35. }
  36. /**
  37. * Constructor (mutable or immutable).
  38. *
  39. * @param value immutable value or <code>null</code> for a mutable value
  40. */
  41. public DirectoryServer(String value) {
  42. super(ContactsNamespace.GCONTACT_NS, XML_NAME, null, value);
  43. setRequired(false);
  44. }
  45. /**
  46. * Returns the extension description, specifying whether it is required, and
  47. * whether it is repeatable.
  48. *
  49. * @param required whether it is required
  50. * @param repeatable whether it is repeatable
  51. * @return extension description
  52. */
  53. public static ExtensionDescription getDefaultDescription(boolean required,
  54. boolean repeatable) {
  55. ExtensionDescription desc =
  56. ExtensionDescription.getDefaultDescription(DirectoryServer.class);
  57. desc.setRequired(required);
  58. desc.setRepeatable(repeatable);
  59. return desc;
  60. }
  61. @Override
  62. public String toString() {
  63. return "{DirectoryServer value=" + getValue() + "}";
  64. }
  65. }