/facebook-java-api/src/main/java/com/google/code/facebookapi/AssociationInfo.java

http://facebook-java-api.googlecode.com/ · Java · 67 lines · 34 code · 12 blank · 21 comment · 0 complexity · e39160bea45a78e0be18b5d214b3f4b0 MD5 · raw file

  1. package com.google.code.facebookapi;
  2. import java.io.Serializable;
  3. /**
  4. * Describes one of two legs of an association. It gives the association a name and optionally specifies its type and uniqueness constraints.
  5. *
  6. * @see <a href="http://wiki.developers.facebook.com/index.php/Data.defineAssociation"> Developers Wiki: Data.defineAssociation</a>
  7. */
  8. @SuppressWarnings("serial")
  9. public class AssociationInfo implements Serializable {
  10. private String alias; // specified in constructor
  11. private String objectType; // default to null
  12. private boolean unique = false; // default to false
  13. public AssociationInfo( String alias ) {
  14. this.alias = alias;
  15. }
  16. public AssociationInfo( String alias, String objectType, boolean unique ) {
  17. this.alias = alias;
  18. this.objectType = objectType;
  19. this.unique = unique;
  20. }
  21. /**
  22. * This alias needs to be a valid identifier, which is no longer than 32 characters, starting with a letter (a-z) and consisting of only small letters (a-z), numbers
  23. * (0-9) and/or underscores.
  24. *
  25. * @return
  26. */
  27. public String getAlias() {
  28. return alias;
  29. }
  30. public void setAlias( String alias ) {
  31. this.alias = alias;
  32. }
  33. /**
  34. * Optional - object type of object identifier. Name it after the table that it's "foreign keying" into.
  35. *
  36. * @return
  37. */
  38. public String getObjectType() {
  39. return objectType;
  40. }
  41. public void setObjectType( String objectType ) {
  42. this.objectType = objectType;
  43. }
  44. /**
  45. * Optional - Default to false. Whether each unique object identifier can only appear once in all associations of this type.
  46. *
  47. * @return
  48. */
  49. public boolean isUnique() {
  50. return unique;
  51. }
  52. public void setUnique( boolean unique ) {
  53. this.unique = unique;
  54. }
  55. }