congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GroupId.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
org.apache.shindig.social.opensocial.spi.GroupId

Best Java code snippets using org.apache.shindig.social.opensocial.spi.GroupId.getType (Showing top 20 results out of 315)

origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * Get the type of the stored objectId.
 *
 * @return GroupId.Type
 */
public Type getType() {
 return getType(this.objectId);
}
origin: org.apache.shindig/shindig-social-api

/**
 * Get the type of the stored objectId.
 *
 * @return GroupId.Type
 */
public Type getType() {
 return getType(this.objectId);
}
origin: com.lmco.shindig/shindig-social-api

private Set<String> getIdSet(UserId user, GroupId group, SecurityToken token)
  throws JSONException {
 String userId = user.getUserId(token);
 if (group == null) {
  return ImmutableSortedSet.of(userId);
 }
 Set<String> returnVal = Sets.newLinkedHashSet();
 switch (group.getType()) {
 case all:
 case friends:
 case groupId:
  if (db.getJSONObject(FRIEND_LINK_TABLE).has(userId)) {
   JSONArray friends = db.getJSONObject(FRIEND_LINK_TABLE).getJSONArray(userId);
   for (int i = 0; i < friends.length(); i++) {
    returnVal.add(friends.getString(i));
   }
  }
  break;
 case self:
  returnVal.add(userId);
  break;
 }
 return returnVal;
}
origin: org.apache.shindig/shindig-social-api

/**
 * Set the objectId with a String
 *
 * @param objectId String
 * @throws IllegalArgumentException
 */
public void setObjectId(String objectId) throws IllegalArgumentException {
 if(getType(objectId).equals(Type.objectId)) {
  this.objectId = new ObjectId(objectId);
 } else {
  this.objectId = objectId;
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * Set the objectId with a String
 *
 * @param objectId String
 * @throws IllegalArgumentException
 */
public void setObjectId(String objectId) throws IllegalArgumentException {
 if(getType(objectId).equals(Type.objectId)) {
  this.objectId = new ObjectId(objectId);
 } else {
  this.objectId = objectId;
 }
}
origin: org.apache.shindig/shindig-social-api

switch (group.getType()) {
case all:
case friends:
origin: org.wso2.org.apache.shindig/shindig-social-api

switch (group.getType()) {
case all:
case friends:
origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * If the given object is an objectId, create and store
 * Else we need the string representation to store, including the "@"
 *
 * @param objectId Object
 * @throws IllegalArgumentException
 */
public GroupId(Object objectId) throws IllegalArgumentException {
 if(objectId == null) {
  this.objectId = new ObjectId("");
 // If it is an objectId, store as is
 } else if(objectId instanceof ObjectId) {
  this.objectId = (ObjectId) objectId;
 // Else it must be a string, store as such
 } else {
  if(Type.objectId.equals(getType(objectId))) {
   this.objectId = new ObjectId(objectId.toString());
  } else {
   this.objectId = objectId.toString();
  }
 }
}
origin: org.apache.shindig/shindig-social-api

/**
 * If the given object is an objectId, create and store
 * Else we need the string representation to store, including the "@"
 *
 * @param objectId Object
 * @throws IllegalArgumentException
 */
public GroupId(Object objectId) throws IllegalArgumentException {
 if(objectId == null) {
  this.objectId = new ObjectId("");
 // If it is an objectId, store as is
 } else if(objectId instanceof ObjectId) {
  this.objectId = (ObjectId) objectId;
 // Else it must be a string, store as such
 } else {
  if(Type.objectId.equals(getType(objectId))) {
   this.objectId = new ObjectId(objectId.toString());
  } else {
   this.objectId = objectId.toString();
  }
 }
}
origin: com.lmco.shindig/shindig-social-api

if (GroupId.Type.self == groupId.getType() && result.isEmpty()) {
 throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "People '" + idSet + "' not found");
origin: org.apache.shindig/shindig-social-api

if (GroupId.Type.self == groupId.getType() && result.isEmpty()) {
 throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "People '" + idSet + "' not found");
origin: org.wso2.org.apache.shindig/shindig-social-api

if (GroupId.Type.self == groupId.getType() && result.isEmpty()) {
 throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "People '" + idSet + "' not found");
origin: com.lmco.shindig/shindig-social-api

 @Test
 public void testFromJson() throws Exception {
  GroupId all = GroupId.fromJson("@all");
  assertEquals(GroupId.Type.all, all.getType());

  GroupId friends = GroupId.fromJson("@friends");
  assertEquals(GroupId.Type.friends, friends.getType());

  GroupId self = GroupId.fromJson("@self");
  assertEquals(GroupId.Type.self, self.getType());

  GroupId group = GroupId.fromJson("superbia");
  assertEquals(GroupId.Type.groupId, group.getType());
  assertEquals("superbia", group.getGroupId());
 }
}
origin: org.apache.shindig/shindig-social-api

@Test
public void testFromJson() {
 GroupId all = GroupId.fromJson("@all");
 assertEquals(GroupId.Type.all, all.getType());
 GroupId friends = GroupId.fromJson("@friends");
 assertEquals(GroupId.Type.friends, friends.getType());
 GroupId self = GroupId.fromJson("@self");
 assertEquals(GroupId.Type.self, self.getType());
 GroupId group = GroupId.fromJson("superbia");
 assertEquals(GroupId.Type.objectId, group.getType());
 assertEquals("superbia", group.getObjectId().toString());
 GroupId unknown = GroupId.fromJson("@foo");
 assertEquals(Type.custom, unknown.getType());
 assertEquals("@foo", unknown.getObjectId().toString());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testFromJson() {
 GroupId all = GroupId.fromJson("@all");
 assertEquals(GroupId.Type.all, all.getType());
 GroupId friends = GroupId.fromJson("@friends");
 assertEquals(GroupId.Type.friends, friends.getType());
 GroupId self = GroupId.fromJson("@self");
 assertEquals(GroupId.Type.self, self.getType());
 GroupId group = GroupId.fromJson("superbia");
 assertEquals(GroupId.Type.objectId, group.getType());
 assertEquals("superbia", group.getObjectId().toString());
 GroupId unknown = GroupId.fromJson("@foo");
 assertEquals(Type.custom, unknown.getType());
 assertEquals("@foo", unknown.getObjectId().toString());
}
origin: org.apache.shindig/shindig-social-api

 @Test
 public void testGetGroup() throws Exception {
  request.setParameter("groupId", "@self");
  assertEquals(GroupId.Type.self, request.getGroup().getType());
 }
}
origin: com.lmco.shindig/shindig-social-api

 @Test
 public void testGetGroup() throws Exception {
  request.setParameter("groupId", "@self");
  assertEquals(GroupId.Type.self, request.getGroup().getType());
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

 @Test
 public void testGetGroup() throws Exception {
  request.setParameter("groupId", "@self");
  assertEquals(GroupId.Type.self, request.getGroup().getType());
 }
}
origin: org.apache.shindig/shindig-social-api

@Test
public void testGroupId() {
 DomainName dn1 = new DomainName("example.com");
 LocalId l1 = new LocalId("195mg90a39v");
 GlobalId gl1 = new GlobalId(dn1, l1);
 GroupId g1 = new GroupId("example.com:195mg90a39v");
 GroupId g2 = new GroupId(gl1);
 assertEquals(g1.getType(), g2.getType());
 assertEquals(g1.getObjectId().toString(), g2.getObjectId().toString());
 GroupId g3 =  new GroupId("@foo");
 assertEquals(Type.custom, g3.getType());
 assertEquals("@foo", g3.getObjectId().toString());
 GroupId g4 = new GroupId(Type.objectId, "example.com:195mg90a39v");
 assertEquals(Type.objectId, g4.getType());
 assertEquals("example.com:195mg90a39v", g4.getObjectId().toString());
 GroupId g5 = new GroupId(Type.custom, "@foo");
 assertEquals(Type.custom, g5.getType());
 assertEquals("@foo", g5.getObjectId().toString());
 GroupId g6 = new GroupId(Type.all, "something");
 assertEquals(Type.all, g6.getType());
 assertEquals("@all", g6.getObjectId().toString());
 GroupId g7 = new GroupId(Type.self, null);
 assertEquals(Type.self, g7.getType());
 assertEquals("@self", g7.getObjectId().toString());
 GroupId g8 = new GroupId(Type.friends, "bar");
 assertEquals(Type.friends, g8.getType());
 assertEquals("@friends", g8.getObjectId().toString());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testGroupId() {
 DomainName dn1 = new DomainName("example.com");
 LocalId l1 = new LocalId("195mg90a39v");
 GlobalId gl1 = new GlobalId(dn1, l1);
 GroupId g1 = new GroupId("example.com:195mg90a39v");
 GroupId g2 = new GroupId(gl1);
 assertEquals(g1.getType(), g2.getType());
 assertEquals(g1.getObjectId().toString(), g2.getObjectId().toString());
 GroupId g3 =  new GroupId("@foo");
 assertEquals(Type.custom, g3.getType());
 assertEquals("@foo", g3.getObjectId().toString());
 GroupId g4 = new GroupId(Type.objectId, "example.com:195mg90a39v");
 assertEquals(Type.objectId, g4.getType());
 assertEquals("example.com:195mg90a39v", g4.getObjectId().toString());
 GroupId g5 = new GroupId(Type.custom, "@foo");
 assertEquals(Type.custom, g5.getType());
 assertEquals("@foo", g5.getObjectId().toString());
 GroupId g6 = new GroupId(Type.all, "something");
 assertEquals(Type.all, g6.getType());
 assertEquals("@all", g6.getObjectId().toString());
 GroupId g7 = new GroupId(Type.self, null);
 assertEquals(Type.self, g7.getType());
 assertEquals("@self", g7.getObjectId().toString());
 GroupId g8 = new GroupId(Type.friends, "bar");
 assertEquals(Type.friends, g8.getType());
 assertEquals("@friends", g8.getObjectId().toString());
}
org.apache.shindig.social.opensocial.spiGroupIdgetType

Javadoc

Get the type of the stored objectId.

Popular methods of GroupId

  • <init>
    Backwards Compatibility.
  • fromJson
    Backwards compatibility.
  • getObjectId
    Get the objectId
  • parseType
    Parse the type of the provided objectId.
  • toString
  • typeToString
    Convert a type to string
  • getGroupId

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Kernel (java.awt.image)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • BoxLayout (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now