Codota Logo
GlobalId.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.apache.shindig.social.opensocial.spi.GlobalId
constructor

Best Java code snippets using org.apache.shindig.social.opensocial.spi.GlobalId.<init> (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: org.apache.shindig/shindig-social-api

/**
 * This constructor allows for a String to be passed in order
 * to create an ObjectId. It will store it as a LocalId and
 * verify it as such.
 *
 * @param id The id of the new LocalId that will be created
 * @throws IllegalArgumentException when the id provided could not be parsed
 *   into either a GlobalId or a LocalId
 */
public ObjectId(String id) throws IllegalArgumentException {
 try {
  this.objectId = new GlobalId(id);
 } catch(IllegalArgumentException e1) {
  // Not a valid globalId, try localId
  try {
   this.objectId = new LocalId(id);
  } catch(IllegalArgumentException e2) {
   // Not either so throw exception
    throw new IllegalArgumentException("The provided ObjectId is not valid");
  }
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * This constructor allows for a String to be passed in order
 * to create an ObjectId. It will store it as a LocalId and
 * verify it as such.
 *
 * @param id The id of the new LocalId that will be created
 * @throws IllegalArgumentException when the id provided could not be parsed
 *   into either a GlobalId or a LocalId
 */
public ObjectId(String id) throws IllegalArgumentException {
 try {
  this.objectId = new GlobalId(id);
 } catch(IllegalArgumentException e1) {
  // Not a valid globalId, try localId
  try {
   this.objectId = new LocalId(id);
  } catch(IllegalArgumentException e2) {
   // Not either so throw exception
    throw new IllegalArgumentException("The provided ObjectId is not valid");
  }
 }
}
origin: org.apache.shindig/shindig-social-api

 @Test(expected=IllegalArgumentException.class)
 public void testGlobalIdException() {
  new GlobalId("example.com/test:195mg90a39v");
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

 @Test(expected=IllegalArgumentException.class)
 public void testGlobalIdException() {
  new GlobalId("example.com/test:195mg90a39v");
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testGlobalId() throws Exception {
 DomainName dn = new DomainName("example.com");
 LocalId lid = new LocalId("195mg90a39v");
 GlobalId g1 = new GlobalId(dn, lid);
 assertTrue(g1 instanceof GlobalId);
 GlobalId g2 = new GlobalId("example.com:195mg90a39v");
 assertTrue(g2 instanceof GlobalId);
 GlobalId g3 = new GlobalId("example.com", "195mg90a39v");
 assertTrue(g3 instanceof GlobalId);
}
origin: org.apache.shindig/shindig-social-api

@Test
public void testGlobalId() throws Exception {
 DomainName dn = new DomainName("example.com");
 LocalId lid = new LocalId("195mg90a39v");
 GlobalId g1 = new GlobalId(dn, lid);
 assertTrue(g1 instanceof GlobalId);
 GlobalId g2 = new GlobalId("example.com:195mg90a39v");
 assertTrue(g2 instanceof GlobalId);
 GlobalId g3 = new GlobalId("example.com", "195mg90a39v");
 assertTrue(g3 instanceof GlobalId);
}
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());
}
origin: org.apache.shindig/shindig-social-api

@Test
public void testObjectId() throws Exception {
 LocalId lid = new LocalId("195mg90a39v");
 GlobalId gid = new GlobalId("example.com:195mg90a39v");
 ObjectId o1 = new ObjectId(lid);
 assertTrue(o1 instanceof ObjectId);
 ObjectId o2 = new ObjectId(gid);
 assertTrue(o2 instanceof ObjectId);
 ObjectId o3 = new ObjectId("195mg90a39v");
 assertTrue(o3 instanceof ObjectId);
 assertTrue(o3.getObjectId() instanceof LocalId);
 ObjectId o4 = new ObjectId("example.com:195mg90a39v");
 assertTrue(o4 instanceof ObjectId);
 assertTrue(o4.getObjectId() instanceof GlobalId);
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testObjectId() throws Exception {
 LocalId lid = new LocalId("195mg90a39v");
 GlobalId gid = new GlobalId("example.com:195mg90a39v");
 ObjectId o1 = new ObjectId(lid);
 assertTrue(o1 instanceof ObjectId);
 ObjectId o2 = new ObjectId(gid);
 assertTrue(o2 instanceof ObjectId);
 ObjectId o3 = new ObjectId("195mg90a39v");
 assertTrue(o3 instanceof ObjectId);
 assertTrue(o3.getObjectId() instanceof LocalId);
 ObjectId o4 = new ObjectId("example.com:195mg90a39v");
 assertTrue(o4 instanceof ObjectId);
 assertTrue(o4.getObjectId() instanceof GlobalId);
}
org.apache.shindig.social.opensocial.spiGlobalId<init>

Javadoc

Try to construct a GlobalId with a string that contains a valid DomainName and valid LocalId separated by a colon (:).

Popular methods of GlobalId

  • getDomainName
    Get the domainName
  • getLocalId
    Get the localId

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • setContentView (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now