Codota Logo
ObjectNode.size
Code IndexAdd Codota to your IDE (free)

How to use
size
method
in
org.codehaus.jackson.node.ObjectNode

Best Java code snippets using org.codehaus.jackson.node.ObjectNode.size (Showing top 20 results out of 315)

  • Common ways to obtain ObjectNode
private void myMethod () {
ObjectNode o =
  • Codota IconJsonNodeFactory instance;instance.objectNode()
  • Codota IconObjectMapper mapper;mapper.createObjectNode()
  • Codota IconArrayNode arrayNode;arrayNode.addObject()
  • Smart code suggestions by Codota
}
origin: org.codehaus.jackson/jackson-mapper-asl

/**
 * Method for adding all properties of the given Object, overriding
 * any existing values for those properties.
 * 
 * @param other Object of which properties to add to this object
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode putAll(ObjectNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new LinkedHashMap<String, JsonNode>(len);
    }
    other.putContentsTo(_children);
  }
  return this;
}
origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public boolean equals(Object o)
{
  if (o == this) return true;
  if (o == null) return false;
  if (o.getClass() != getClass()) {
    return false;
  }
  ObjectNode other = (ObjectNode) o;
  if (other.size() != size()) {
    return false;
  }
  if (_children != null) {
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      String key = en.getKey();
      JsonNode value = en.getValue();
      JsonNode otherValue = other.get(key);
      if (otherValue == null || !otherValue.equals(value)) {
        return false;
      }
    }
  }
  return true;
}
origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(32 + (size() << 4));
  sb.append("{");
  if (_children != null) {
    int count = 0;
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      if (count > 0) {
        sb.append(",");
      }
      ++count;
      TextNode.appendQuoted(sb, en.getKey());
      sb.append(':');
      sb.append(en.getValue().toString());
    }
  }
  sb.append("}");
  return sb.toString();
}
origin: camunda/camunda-bpm-platform

/**
 * Method for adding all properties of the given Object, overriding
 * any existing values for those properties.
 * 
 * @param other Object of which properties to add to this object
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode putAll(ObjectNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new LinkedHashMap<String, JsonNode>(len);
    }
    other.putContentsTo(_children);
  }
  return this;
}
origin: camunda/camunda-bpm-platform

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(32 + (size() << 4));
  sb.append("{");
  if (_children != null) {
    int count = 0;
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      if (count > 0) {
        sb.append(",");
      }
      ++count;
      TextNode.appendQuoted(sb, en.getKey());
      sb.append(':');
      sb.append(en.getValue().toString());
    }
  }
  sb.append("}");
  return sb.toString();
}
origin: camunda/camunda-bpm-platform

@Override
public boolean equals(Object o)
{
  if (o == this) return true;
  if (o == null) return false;
  if (o.getClass() != getClass()) {
    return false;
  }
  ObjectNode other = (ObjectNode) o;
  if (other.size() != size()) {
    return false;
  }
  if (_children != null) {
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      String key = en.getKey();
      JsonNode value = en.getValue();
      JsonNode otherValue = other.get(key);
      if (otherValue == null || !otherValue.equals(value)) {
        return false;
      }
    }
  }
  return true;
}
origin: com.barchart.wrap/barchart-wrap-jackson

/**
 * Method for adding all properties of the given Object, overriding
 * any existing values for those properties.
 * 
 * @param other Object of which properties to add to this object
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode putAll(ObjectNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new LinkedHashMap<String, JsonNode>(len);
    }
    other.putContentsTo(_children);
  }
  return this;
}
origin: org.codehaus.jackson/jackson-mapper-lgpl

/**
 * Method for adding all properties of the given Object, overriding
 * any existing values for those properties.
 * 
 * @param other Object of which properties to add to this object
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode putAll(ObjectNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new LinkedHashMap<String, JsonNode>(len);
    }
    other.putContentsTo(_children);
  }
  return this;
}
origin: ovea-deprecated/jetty-session-redis

/**
 * Method for adding all properties of the given Object, overriding
 * any existing values for those properties.
 * 
 * @param other Object of which properties to add to this object
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode putAll(ObjectNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new LinkedHashMap<String, JsonNode>(len);
    }
    other.putContentsTo(_children);
  }
  return this;
}
origin: org.codehaus.jackson/jackson-mapper-lgpl

@Override
public boolean equals(Object o)
{
  if (o == this) return true;
  if (o == null) return false;
  if (o.getClass() != getClass()) {
    return false;
  }
  ObjectNode other = (ObjectNode) o;
  if (other.size() != size()) {
    return false;
  }
  if (_children != null) {
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      String key = en.getKey();
      JsonNode value = en.getValue();
      JsonNode otherValue = other.get(key);
      if (otherValue == null || !otherValue.equals(value)) {
        return false;
      }
    }
  }
  return true;
}
origin: ovea-deprecated/jetty-session-redis

@Override
public boolean equals(Object o)
{
  if (o == this) return true;
  if (o == null) return false;
  if (o.getClass() != getClass()) {
    return false;
  }
  ObjectNode other = (ObjectNode) o;
  if (other.size() != size()) {
    return false;
  }
  if (_children != null) {
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      String key = en.getKey();
      JsonNode value = en.getValue();
      JsonNode otherValue = other.get(key);
      if (otherValue == null || !otherValue.equals(value)) {
        return false;
      }
    }
  }
  return true;
}
origin: org.codehaus.jackson/jackson-mapper-lgpl

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(32 + (size() << 4));
  sb.append("{");
  if (_children != null) {
    int count = 0;
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      if (count > 0) {
        sb.append(",");
      }
      ++count;
      TextNode.appendQuoted(sb, en.getKey());
      sb.append(':');
      sb.append(en.getValue().toString());
    }
  }
  sb.append("}");
  return sb.toString();
}
origin: com.barchart.wrap/barchart-wrap-jackson

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(32 + (size() << 4));
  sb.append("{");
  if (_children != null) {
    int count = 0;
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      if (count > 0) {
        sb.append(",");
      }
      ++count;
      TextNode.appendQuoted(sb, en.getKey());
      sb.append(':');
      sb.append(en.getValue().toString());
    }
  }
  sb.append("}");
  return sb.toString();
}
origin: oVirt/ovirt-engine

/**
 * @param keyValues The map to turn into the string.
 * @return A string of format {"key":"value",...}
 */
String getMessagesFromMap(final Map<String, String> keyValues) {
  ObjectNode node = objectMapper.createObjectNode();
  for (Map.Entry<String, String> entry : keyValues.entrySet()) {
    node.put(entry.getKey(), entry.getValue());
  }
  return node.size() > 0 ? node.toString() : null;
}
origin: ovea-deprecated/jetty-session-redis

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(32 + (size() << 4));
  sb.append("{");
  if (_children != null) {
    int count = 0;
    for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
      if (count > 0) {
        sb.append(",");
      }
      ++count;
      TextNode.appendQuoted(sb, en.getKey());
      sb.append(':');
      sb.append(en.getValue().toString());
    }
  }
  sb.append("}");
  return sb.toString();
}
origin: com.ngdata/hbase-indexer-model

public UpdateIndexerInput fromJsonBytes(byte [] jsonBytes) {
 ObjectNode node = null;
 try {
  node = (ObjectNode) new ObjectMapper().readTree(new ByteArrayInputStream(jsonBytes));
 } catch (IOException e) {
  throw new JsonFormatException("Error parsing indexer definition JSON.", e);
 }
 if (node.size() != 2) {
  new JsonFormatException("Expected object field of size 2, got size " + node.size());
 }
 IndexerDefinition baseIndexer = getDefinitionFromNode(node,"baseIndexer").build();
 IndexerDefinition newIndexer = getDefinitionFromNode(node, "newIndexer").build();
 return new UpdateIndexerInput(newIndexer, baseIndexer);
}
origin: eBay/YiDB

@Test
public void testProjection09() {
  String query = "ApplicationService[@resourceId=~\"srp-app.*\"]{*}.accessPoints{*}";
  cmsdbContext.setShowDisplayMeta(true);
  cmsdbContext.setAllowFullTableScan(true);
  IQueryResult result = queryService.query(query, cmsdbContext);
  Assert.assertNotNull(result.getDisplayMeta());
  ObjectNode apDisplay = (ObjectNode) result.getDisplayMeta().get(0).get("fields").get("accessPoints")
      .get("refDataType").get("AccessPoint").get("fields");
  MetaClass meta = cmsdbMetaService.getMetaClass("AccessPoint");
  Assert.assertEquals(meta.getFieldNames().size(), apDisplay.size());
}
origin: eBay/YiDB

@Test
public void testProject08() {
  String query = "Rack{@location}.assets.asset!AssetServer{@resourceId,@faultDomain}";
  cmsdbContext.setAllowFullTableScan(true);
  cmsdbContext.setShowDisplayMeta(true);
  IQueryResult result = queryService.query(query, cmsdbContext);
  Assert.assertNotNull(result.getDisplayMeta());
  Assert.assertEquals(1, result.getDisplayMeta().size());
  // reverse
  ObjectNode rackDisplay = (ObjectNode) result.getDisplayMeta().get(0).get("fields");
  Assert.assertEquals(4, rackDisplay.size());
  ObjectNode assetDisplay = (ObjectNode) rackDisplay.get("assets").get("refDataType").get("Asset").get("fields");
  Assert.assertEquals(3, assetDisplay.size());
  ObjectNode assetServerDisplay = (ObjectNode) assetDisplay.get("asset!AssetServer").get("refDataType")
      .get("AssetServer").get("fields");
  Assert.assertEquals(4, assetServerDisplay.size());
}
origin: eBay/YiDB

/**
 * Set query
 */
@Test
public void testProject07() {
  raptorContext.setAllowFullTableScan(true);
  raptorContext.setShowDisplayMeta(true);
  String query = "ApplicationService.(services{@_oid}&&updateStrategies{@_type})";
  IQueryResult result = queryService.query(query, raptorContext);
  ArrayNode display = result.getDisplayMeta();
  Assert.assertEquals(2, display.size());
  ObjectNode servDisplay = (ObjectNode) display.get(0).get("fields");
  Assert.assertEquals(2, servDisplay.size());
  ObjectNode usDisplay = (ObjectNode) display.get(1).get("fields");
  Assert.assertEquals(2, usDisplay.size());
}
origin: eBay/YiDB

@Test
public void testProject06() {
  // case 0 : aggregation
  String query = "NetworkAddress<@healthState>{@healthState, $max(@address), $count()}";
  cmsdbContext.setAllowFullTableScan(true);
  cmsdbContext.setShowDisplayMeta(true);
  IQueryResult result = queryService.query(query, cmsdbContext);
  ArrayNode display = result.getDisplayMeta();
  ObjectNode na = (ObjectNode) display.get(0).get("fields");
  Assert.assertEquals(5, na.size());
  Assert.assertTrue(na.has("healthState"));
  Assert.assertTrue(na.has("$count"));
  Assert.assertTrue(na.has("$max_address"));
}
org.codehaus.jackson.nodeObjectNodesize

Popular methods of ObjectNode

  • put
    Method for setting value of a field to specified binary value
  • get
  • getFields
    Method to use for accessing all fields (with both names and values) of this JSON Object.
  • toString
  • putArray
    Method that will construct an ArrayNode and add it as a field of this ObjectNode, replacing old valu
  • has
  • remove
    Method for removing specified field properties out of this ObjectNode.
  • objectNode
  • <init>
  • arrayNode
  • putObject
    Method that will construct an ObjectNode and add it as a field of this ObjectNode, replacing old val
  • nullNode
  • putObject,
  • nullNode,
  • path,
  • putNull,
  • POJONode,
  • _put,
  • binaryNode,
  • booleanNode,
  • equals

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JList (javax.swing)
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
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