Java 8 CompositeDataSupport - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 CompositeDataSupport class.

This code example shows how to use the following methods:get
        DN entryDn = getDn();
 
        Attributes attributes = new Attributes(); 
        attributes.addValue("objectClass", "monitoredObject"); 
 
        Long committed = (Long)heapMemoryUsage.get("committed");
        attributes.addValue("committed", committed);
 
        Long init = (Long)heapMemoryUsage.get("init");
        attributes.addValue("init", init);
 
        Long max = (Long)heapMemoryUsage.get("max");
        attributes.addValue("max", max);
 
        Long used = (Long)heapMemoryUsage.get("used");
        attributes.addValue("used", used);
 
        SearchResult result = new SearchResult(entryDn, attributes);
        result.setEntryName(getName());
 
6
CodeRank
This code example shows how to use the following methods:get
        return compositeData;
    } 
 
    public static TaskStatus getTaskStatus(CompositeDataSupport compositeData) {
 
        final TaskStatus status = new TaskStatus((Status)compositeData.get("status"));
        status._reason = compositeData.get("reason");
        status._statusChangeTime = (Date) compositeData.get("statusChangeTime");
        status._percentageDone = ((Integer) compositeData.get("percentage"));
        return status;
    } 
 
    @Override 
    public String toString() {
        return status.toString();
    } 
} 
5
CodeRank
This code example shows how to use the following methods:get
		 
		if (not.getType().equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
			CompositeDataSupport data=(CompositeDataSupport) not.getUserData();
			 
			 
			String poolName = (String) data.get("poolName");
			MemoryType type = types.get(poolName);
			if(type==MemoryType.HEAP){
				// clear heap 
				aprint.e("Clear heap!"); 
			} 
			else if(type==MemoryType.NON_HEAP) {
				// clear none-heap 
				((Config) handback).checkPermGenSpace(false);
			} 
			 
			/*CompositeDataSupport usage=(CompositeDataSupport) data.get("usage"); 
			print.e(poolName); 
			print.e(types.get(poolName)); 
			print.e(data.get("count")); 
5
CodeRank
This code example shows how to use the following methods:
    elements.put(FAILED, fail);
    elements.put(ERRORS, error);
    elements.put(TOTAL, total);
    elements.put(PERCENTAGE, total > 0 ? ((double) success / (double) total) * 100d : 0d); // 2dp-ish
    try { 
      return new CompositeDataSupport(type, elements);
    } catch (OpenDataException ex) {
      s_logger.error("Error creating composite data support object", ex);
      throw new OpenGammaRuntimeException("Error creating composite data support object", ex);
    } 
  } 
   
  public static CompositeType getCompositeType() {
    try { 
      return new CompositeType("ColumnRequirementsBySecurityType", 
          "Number of successes or failures for a value requirement by security type",  
          new String[] {SECURITY_TYPE, 
                        REQUIREMENT_NAME, 
                        VALUE_PROPERTIES, 
                        SUCCEEDED, 
5
CodeRank
This code example shows how to use the following methods:
        itemNames.add(itemName);
        itemValues.add(itemValue);
    } 
 
    public CompositeData createCompositeData() throws OpenDataException {
        return new CompositeDataSupport(compositeType, itemNames
                .toArray(new String[itemNames.size()]), itemValues.toArray());
    } 
 
    public void clear() { 
        itemNames.clear();
        itemValues.clear(); 
    } 
} 
3
CodeRank
This code example shows how to use the following methods:
            return new ExoticCompositeData(whatsit.substring(1));
        } 
 
        public CompositeData toCompositeData(CompositeType ct) {
            try { 
                return new CompositeDataSupport(ct, new String[] {"whatsit"},
                                                new String[] {"!" + whatsit});
            } catch (Exception e) {
                throw new RuntimeException(e);
            } 
        } 
 
        public String getWhatsit() {
            return whatsit;
        } 
 
        public boolean equals(Object o) { 
            return ((o instanceof ExoticCompositeData) && 
                    ((ExoticCompositeData) o).whatsit.equals(whatsit));
        } 
3
CodeRank
This code example shows how to use the following methods:
    elements.put(FAILED, fail);
    elements.put(ERRORS, error);
    elements.put(TOTAL, total);
    elements.put(PERCENTAGE, (total > 0) ? ((double) success / (double) total) * 100d : 0d); // 2dp-ish
    try { 
      return new CompositeDataSupport(type, elements);
    } catch (OpenDataException ex) {
      s_logger.error("Error creating composite data support object", ex);
      return null; 
    } 
  } 
   
  public static CompositeType getCompositeType() {
    try { 
      return new CompositeType("ColumnRequirements", 
          "Number of successes or failures for a value requirement by security type",  
          new String[] {REQUIREMENT_NAME, 
                        VALUE_PROPERTIES,
                        SUCCEEDED, 
                        FAILED, 
5
CodeRank
This code example shows how to use the following methods:
                this.currentSize,
                this.parentClassName};
 
        CompositeData cData= null;
        try { 
            cData= new CompositeDataSupport(cType_, itemNames_, itemValues);
        } catch( OpenDataException ode) {
            // this won't happen, but in case it does we should log 
            throw new RuntimeException(ode);
        } 
        return cData;
    } 
     
 
    public String getClassName() {
        return className;
    } 
 
    public String getCacheType() {
        return cacheType;
3
CodeRank
This code example shows how to use the following methods:
	/** 
	 * toCompositeData 
	 */ 
	public CompositeData toCompositeData() {
		try { 
			return new CompositeDataSupport(
					COMPOSITE_TYPE, ITEM_NAMES, new Object[] {
					query, cacheHitCount, cacheMissCount, 
					cachePutCount, 
					executionCount, 
					executionRowCount, 
					executionAvgTime, 
					executionMaxTime, 
					executionMinTime, 
			} 
			); 
		} 
		catch ( OpenDataException e ) {
			throw new RuntimeException( e );
		} 
4
CodeRank
This code example shows how to use the following methods:
                                                 "Composite Data Attribute", 
                                                 itemNames,
                                                 itemDescriptions,
                                                 itemTypes);
            Object itemValues[] = { ia, da, sa }; 
            return new CompositeDataSupport(ct, itemNames, itemValues);
        } 
 
        public Integer ia;
        public Double da;
        public String sa;
 
        private String itemNames[] = { "IntegerAttribute",
                                       "DoubleAttribute", 
                                       "StringAttribute" }; 
        private String itemDescriptions[] = { "Integer Attribute",
                                              "Double Attribute", 
                                              "String Attribute" }; 
        private OpenType itemTypes[] = { SimpleType.INTEGER,
                                         SimpleType.DOUBLE,
4
CodeRank
See Code Examples for Java 8 CompositeDataSupport Methods: