public int getElementCount()

in protonj2/src/main/java/org/apache/qpid/protonj2/codec/encoders/messaging/SourceTypeEncoder.java [98:124]


    public int getElementCount(Source source) {
        if (source.getCapabilities() != null) {
            return 11;
        } else if (source.getOutcomes() != null) {
            return 10;
        } else if (source.getDefaultOutcome() != null) {
            return 9;
        } else if (source.getFilter() != null) {
            return 8;
        } else if (source.getDistributionMode() != null) {
            return 7;
        } else if (source.getDynamicNodeProperties() != null) {
            return 6;
        } else if (source.isDynamic()) {
            return 5;
        } else if (source.getTimeout() != null && !source.getTimeout().equals(UnsignedInteger.ZERO)) {
            return 4;
        } else if (source.getExpiryPolicy() != null && source.getExpiryPolicy() != TerminusExpiryPolicy.SESSION_END) {
            return 3;
        } else if (source.getDurable() != null && source.getDurable() != TerminusDurability.NONE) {
            return 2;
        } else if (source.getAddress() != null) {
            return 1;
        } else {
            return 0;
        }
    }