Allows for reconstruction via CompositeData.

@param cd
composite data
@return Red5 class instance
495352
public static Red5 from(CompositeData cd) {
        Red5 instance = null;
        if (cd.containsKey("connection")) {
            Object cn = cd.get("connection");
            if (cn != null && cn instanceof IConnection) {
                instance = new Red5((IConnection) cn);
            } else {
                instance = new Red5();
            }
        } else {
            instance = new Red5();
        }
        return instance;
    }
599153
public Object decode(CachedData d) {
    byte[] data = d.getData();
    Object rv = null;
    if ((d.getFlags() & COMPRESSED) != 0) {
      data = decompress(d.getData());
    }
    int flags = d.getFlags() & SPECIAL_MASK;
    if ((d.getFlags() & SERIALIZED) != 0 && data != null) {
      rv = deserialize(data);
    } else if (flags != 0 && data != null) {
      switch (flags) {
      case SPECIAL_BOOLEAN:
        rv = Boolean.valueOf(tu.decodeBoolean(data));
        break;
      case SPECIAL_INT:
        rv = Integer.valueOf(tu.decodeInt(data));
        break;
      case SPECIAL_LONG:
        rv = Long.valueOf(tu.decodeLong(data));
        break;
      case SPECIAL_DATE:
        rv = new Date(tu.decodeLong(data));
        break;
      case SPECIAL_BYTE:
        rv = Byte.valueOf(tu.decodeByte(data));
        break;
      case SPECIAL_FLOAT:
        rv = new Float(Float.intBitsToFloat(tu.decodeInt(data)));
        break;
      case SPECIAL_DOUBLE:
        rv = new Double(Double.longBitsToDouble(tu.decodeLong(data)));
        break;
      case SPECIAL_BYTEARRAY:
        rv = data;
        break;
      default:
        getLogger().warn("Undecodeable with flags %x", flags);
      }
    } else {
      rv = decodeString(data);
    }
    return rv;
  }
346505
String getFormattedCompositeData(CompositeData cd, String indent) {
        StringBuilder sb = new StringBuilder();
        indent += INDENT;
        CompositeType type = cd.getCompositeType();
        for (String key : type.keySet()) {
            sb.append("\n").append(indent);
            sb.append(key).append(": ");
            OpenType<?> openType = type.getType(key);
            if (openType instanceof SimpleType) {
                sb.append(cd.get(key));
            } else if (openType instanceof CompositeType) {
                CompositeData nestedData = (CompositeData) cd.get(key);
                sb.append(getFormattedCompositeData(nestedData, indent));
            } else if (openType instanceof TabularType) {
                TabularData tabularData = (TabularData) cd.get(key);
                sb.append(tabularData);
            }
        }
        return String.valueOf(sb);
    }
335202
protected void addPartialInfo(ClassDoc cd, Content contentTree) {
        addPreQualifiedStrongClassLink(LinkInfoImpl.Kind.TREE, cd, contentTree);
    }
1364923
private SortedSet<ClassDoc> get(Map<ClassDoc, SortedSet<ClassDoc>> map, ClassDoc cd) {
        SortedSet<ClassDoc> aset = map.get(cd);
        if (aset == null) {
            return new TreeSet<>(comparator);
        }
        return aset;
    }
872278
public static JavaRDD<List<Writable>> restoreSequenceFile(String path, JavaSparkContext sc) {
        return restoreMapFile(path, sc).values();
    }
666444
protected File getContentSrcAsFile(IRI contentSrc, File tempDir) throws ObjectIntegrityException, IOException {
        if (contentSrc.isAbsolute() || contentSrc.isPathAbsolute()) {
            throw new ObjectIntegrityException("contentSrc must not be absolute");
        }
        try {
            // Normalize the IRI to resolve percent-encoding and
            // backtracking (e.g. "../")
            NormalizedURI nUri = new NormalizedURI(tempDir.toURI().toString() + contentSrc.toString());
            nUri.normalize();

            File f = new File(nUri.toURI());
            if (f.getParentFile().equals(tempDir)) {
                File temp = File.createTempFile("binary-datastream", null);
                FileUtils.move(f, temp);
                temp.deleteOnExit();
                return temp;
                //return f;
            } else {
                throw new ObjectIntegrityException(contentSrc.toString()
                                                   + " is not a valid path.");
            }
        } catch (URISyntaxException e) {
            throw new ObjectIntegrityException(e.getMessage(), e);
        }
    }
533280
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public SpanContext fromBinarySpanContext(Data data) throws SpanContextParseException {
    return data.binaryFormat.fromByteArray(data.spanContextBinary);
  }
1047088
public Options getOptionsFor(ClassDoc cd) {
	Options localOpt = getGlobalOptions();
	overrideForClass(localOpt, cd);
	localOpt.setOptions(cd);
	return localOpt;
    }
1114116
@Override
    public JsonObject serialize(CallDetailRecordList cdrList, Type type, JsonSerializationContext context) {

        JsonObject result = new JsonObject();

        JsonArray array = new JsonArray();
        for (CallDetailRecord cdr : cdrList.getCallDetailRecords()) {
            array.add(context.serialize(cdr));
        }

        if (total != null && pageSize != null && page != null) {
            result.addProperty("page", page);
            result.addProperty("num_pages", getTotalPages());
            result.addProperty("page_size", pageSize);
            result.addProperty("total", total);
            result.addProperty("start", getFirstIndex());
            result.addProperty("end", getLastIndex(cdrList));
            result.addProperty("uri", pathUri);
            result.addProperty("first_page_uri", getFirstPageUri());
            result.addProperty("previous_page_uri", getPreviousPageUri());
            result.addProperty("next_page_uri", getNextPageUri(cdrList));
            result.addProperty("last_page_uri", getLastPageUri());
        }

        result.add("calls", array);

        return result;
    }
656318
public String toText(CompositeData cd)
	{ 
		if(cd == null)
			return null;
		
		 Object property = cd.get("value");
		 
		 return String.valueOf(property);
	}
911699
private Collection<ClassDoc> subclasses(ClassDoc cd) {
        Collection<ClassDoc> ret = classToSubclass.get(cd.qualifiedName());
        if (ret == null) {
            ret = new TreeSet<>(utils.makeComparatorForClassUse());
            SortedSet<ClassDoc> subs = classtree.subclasses(cd);
            if (subs != null) {
                ret.addAll(subs);
                for (ClassDoc sub : subs) {
                    ret.addAll(subclasses(sub));
                }
            }
            addAll(classToSubclass, cd, ret);
        }
        return ret;
    }
110812
public static Map<String, IDLProxyObject> create(String data, boolean debug, File path, boolean isUniName) {
        ProtoFile protoFile = ProtoParser.parse(DEFAULT_FILE_NAME, data);
        List<CodeDependent> cds = new ArrayList<CodeDependent>();
        try {
            return doCreate(protoFile, true, debug, path, false, null, cds, new HashMap<String, String>(), isUniName);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
641387
public Detail read (String category, String discid)
        throws IOException, CDDBException
    {
        // sanity check
        if (_sock == null) {
            throw new CDDBException(500, "Not connected");
        }

        // construct the query
        StringBuilder req = new StringBuilder("cddb read ");
        req.append(category).append(" ");
        req.append(discid);

        // make the request
        Response rsp = request(req.toString());
        // anything other than an OK response earns an exception
        if (rsp.code != 210 /* OK, entry follows */) {
            throw new CDDBException(rsp.code, rsp.message);
        }

        Detail detail = new Detail();

        // parse the category and discid from the response string
        int sidx = rsp.message.indexOf(" ");
        if (sidx == -1) {
            throw new CDDBException(500, "Malformed read response: " +
                                    rsp.message);
        }
        detail.category = rsp.message.substring(0, sidx);
        detail.discid = rsp.message.substring(sidx+1);

        ArrayList<String> tnames = new ArrayList<String>();
        ArrayList<String> texts = new ArrayList<String>();

        // now parse the contents
        String input = _in.readLine();
        for (int lno = 0; !input.equals(CDDBProtocol.TERMINATOR); lno++) {
            if (input.startsWith("#")) {
                // skip comments

            } else if (input.startsWith("DTITLE")) {
                if (detail.title == null) {
                    detail.title = contents(input, lno);
                } else {
                    detail.title += contents(input, lno);
                }

            } else if (input.startsWith("DYEAR")) {
                String yearStr = contents(input, lno);
                try {
                    detail.year = Integer.parseInt(yearStr);
                } catch (NumberFormatException nfEx) {
                    detail.year = -1;
                }

            } else if (input.startsWith("DGENRE")) {
                if (detail.genre == null) {
                    detail.genre = contents(input, lno);
                } else {
                    detail.genre += contents(input, lno);
                }

            } else if (input.startsWith("EXTD")) {
                if (detail.extendedData == null) {
                    detail.extendedData = contents(input, lno);
                } else {
                    detail.extendedData += contents(input, lno);
                }

            } else if (input.startsWith("TTITLE")) {
                append(tnames, index(input, "TTITLE", lno), contents(input, lno));

            } else if (input.startsWith("EXTT")) {
                append(texts, index(input, "EXTT", lno), contents(input, lno));
            }

            // read in the next line of input
            input = _in.readLine();
        }

        // convert the lists into arrays
        detail.trackNames = new String[tnames.size()];
        tnames.toArray(detail.trackNames);
        detail.extendedTrackData = new String[texts.size()];
        texts.toArray(detail.extendedTrackData);

        return detail;
    }
898119
public List<ClassDoc> allSubs(ClassDoc cd, boolean isEnum) {
        List<ClassDoc> list = subs(cd, isEnum);
        for (int i = 0; i < list.size(); i++) {
            cd = list.get(i);
            List<ClassDoc> tlist = subs(cd, isEnum);
            for (int j = 0; j < tlist.size(); j++) {
                ClassDoc tcd = tlist.get(j);
                if (!list.contains(tcd)) {
                    list.add(tcd);
                }
            }
        }
        Collections.sort(list);
        return list;
    }
899890
public Content getConstantMembersHeader(ClassDoc cd) {
        //generate links backward only to public classes.
        Content classlink = (cd.isPublic() || cd.isProtected()) ?
            getLink(new LinkInfoImpl(configuration,
                    LinkInfoImpl.Kind.CONSTANT_SUMMARY, cd)) :
            new StringContent(cd.qualifiedName());
        String name = cd.containingPackage().name();
        if (name.length() > 0) {
            Content cb = new ContentBuilder();
            cb.addContent(name);
            cb.addContent(".");
            cb.addContent(classlink);
            return getClassName(cb);
        } else {
            return getClassName(classlink);
        }
    }
1028440
public String getClassName(ClassDoc cd) {
        PackageDoc pd = cd.containingPackage();
        if (pd != null && shouldExcludeQualifier(cd.containingPackage().name())) {
            return cd.name();
        } else {
            return cd.qualifiedName();
        }
    }