PageRenderTime 29ms CodeModel.GetById 17ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

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