PageRenderTime 59ms CodeModel.GetById 34ms RepoModel.GetById 1ms app.codeStats 0ms

/CCBridge/gdata/java/src/com/google/gdata/data/projecthosting/Username.java

https://bitbucket.org/javirosa/greenwifiucb
Java | 76 lines | 29 code | 11 blank | 36 comment | 0 complexity | 552e1ef8a2cefd933112b19618a3b513 MD5 | raw file
Possible License(s): Apache-2.0
  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.projecthosting;
  16. import com.google.gdata.data.ExtensionDescription;
  17. import com.google.gdata.data.ValueConstruct;
  18. /**
  19. * Username of a user.
  20. *
  21. *
  22. */
  23. @ExtensionDescription.Default(
  24. nsAlias = ProjectHostingNamespace.ISSUES_ALIAS,
  25. nsUri = ProjectHostingNamespace.ISSUES,
  26. localName = Username.XML_NAME)
  27. public class Username extends ValueConstruct {
  28. /** XML element name */
  29. static final String XML_NAME = "username";
  30. /**
  31. * Default mutable constructor.
  32. */
  33. public Username() {
  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 Username(String value) {
  42. super(ProjectHostingNamespace.ISSUES_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(Username.class);
  57. desc.setRequired(required);
  58. desc.setRepeatable(repeatable);
  59. return desc;
  60. }
  61. @Override
  62. public String toString() {
  63. return "{Username value=" + getValue() + "}";
  64. }
  65. }