package org.buddycloud.channelserver.channel.node.configuration.field;

public class Affiliation extends Field
{
	public static final String FIELD_NAME    = "pubsub#default_affiliation";
	public static final String DEFAULT_VALUE = Affiliation.models.MEMBER.toString();
	
	public enum models { 
		FOLLOWER_AND_POST("publisher"), MEMBER("follower");
		String model = null;
		private models(String model) {
			this.model = model;
		}
		public String toString() {
	        return model;
	    }
	}

	public Affiliation()
	{
		name = FIELD_NAME;
	}
	
	public boolean isValid()
	{
		return (getValue().equals(Affiliation.models.FOLLOWER_AND_POST.toString())
			|| getValue().equals(Affiliation.models.MEMBER.toString())
		);
	}
}

@@ -103,17 +103,17 @@
 ds Field
-%0A
+ 
 %7B%0A%09publi
@@ -145,19 +145,16 @@
 LD_NAME 
-   
 = %22pubsu
@@ -238,32 +238,36 @@
 on.models.MEMBER
+%0A%09%09%09
 .toString();%0A%09%0A%09
@@ -263,17 +263,16 @@
 ring();%0A
-%09
 %0A%09public
@@ -285,17 +285,16 @@
 models %7B
- 
 %0A%09%09FOLLO
@@ -338,16 +338,61 @@
 llower%22)
+, OWNER(%22owner%22), MODERATOR(%0A%09%09%09%09%22moderator%22)
 ;%0A%09%09Stri
@@ -408,16 +408,17 @@
 = null;%0A
+%0A
 %09%09privat
@@ -469,16 +469,17 @@
 el;%0A%09%09%7D%0A
+%0A
 %09%09public
@@ -504,16 +504,10 @@
  %7B%0A%09
-        
+%09%09
 retu
@@ -521,12 +521,9 @@
 l;%0A%09
-    
+%09
 %7D%0A%09%7D
@@ -545,18 +545,17 @@
 iation()
-%0A%09
+ 
 %7B%0A%09%09name
@@ -572,17 +572,16 @@
 AME;%0A%09%7D%0A
-%09
 %0A%09public
@@ -598,18 +598,17 @@
 sValid()
-%0A%09
+ 
 %7B%0A%09%09retu
@@ -621,32 +621,37 @@
 tValue().equals(
+%0A%09%09%09%09
 Affiliation.mode
@@ -682,20 +682,24 @@
 tring())
+ 
 %0A%09%09
-%09
+    
 %7C%7C getVa
@@ -751,16 +751,151 @@
 ng())%0A%09%09
+    %7C%7C getValue().equals(Affiliation.models.OWNER.toString())%0A%09%09    %7C%7C getValue().equals(Affiliation.models.MODERATOR.toString())%0A%09    
 );%0A%09%7D%0A%7D%0A

Fix for default_affiliation valid values