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

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

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

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

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

/**
 * 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

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

 @Test(expected=IllegalArgumentException.class)
 public void testObjectIdException() {
  new ObjectId("195mg90a39v/937194");
 }
}
origin: org.apache.shindig/shindig-social-api

 @Test(expected=IllegalArgumentException.class)
 public void testObjectIdException() {
  new ObjectId("195mg90a39v/937194");
 }
}
origin: org.apache.shindig/shindig-social-api

/**
 * Backwards Compatibility.
 *
 * @param type
 * @param objectId
 * @throws IllegalArgumentException when the provided objectId is not valid
 */
public GroupId(Type type, String objectId) throws IllegalArgumentException {
 // If Type is an objectId, convert objectId to ObjectId and store
 if(type.equals(Type.objectId)) {
  this.objectId = new ObjectId(objectId);
 // Else store the string representation of the type
 } else if(Type.custom.equals(type)){
  //Custom @ id
  this.objectId = objectId;
 } else {
  this.objectId = typeToString(type);
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * Backwards Compatibility.
 *
 * @param type
 * @param objectId
 * @throws IllegalArgumentException when the provided objectId is not valid
 */
public GroupId(Type type, String objectId) throws IllegalArgumentException {
 // If Type is an objectId, convert objectId to ObjectId and store
 if(type.equals(Type.objectId)) {
  this.objectId = new ObjectId(objectId);
 // Else store the string representation of the type
 } else if(Type.custom.equals(type)){
  //Custom @ id
  this.objectId = objectId;
 } else {
  this.objectId = typeToString(type);
 }
}
org.apache.shindig.social.opensocial.spiObjectId

Javadoc

ObjectId as defined by the OpenSocial 2.0.1 Spec

Most used methods

  • <init>
    This constructor allows for a LocalId to be passed in order to create an ObjectId.
  • getObjectId
    Get the objectId.

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Vim 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