Tabnine Logo
GlobalId
Code IndexAdd Tabnine to your IDE (free)

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

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

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.apache.shindig/shindig-social-api

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (!(o instanceof GlobalId)) {
  return false;
 }
 GlobalId actual = (GlobalId) o;
 return this.getDomainName().equals(actual.getDomainName())
   && this.getLocalId().equals(actual.getLocalId());
}
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.wso2.org.apache.shindig/shindig-social-api

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (!(o instanceof GlobalId)) {
  return false;
 }
 GlobalId actual = (GlobalId) o;
 return this.getDomainName().equals(actual.getDomainName())
   && this.getLocalId().equals(actual.getLocalId());
}
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

Javadoc

GlobalId as defined by the OpenSocial 2.0.1 Spec

Most used methods

  • <init>
    Construct a GlobalId with the provided a valid DomainName and LocalId
  • getDomainName
    Get the domainName
  • getLocalId
    Get the localId

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (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
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Permission (java.security)
    Legacy security code; do not use.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Github Copilot alternatives
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