http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/Decimal128.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/Decimal128.java b/proton-j/codec/src/org/apache/qpid/proton/type/Decimal128.java deleted file mode 100644 index 9b89cdd..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/Decimal128.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -import java.math.BigDecimal; - -public class Decimal128 extends Number -{ - private final BigDecimal _underlying; - private final long _msb; - private final long _lsb; - - public Decimal128(BigDecimal underlying) - { - _underlying = underlying; - - _msb = calculateMostSignificantBits(underlying); - _lsb = calculateLeastSignificantBits(underlying); - } - - - public Decimal128(final long msb, final long lsb) - { - _msb = msb; - _lsb = lsb; - - _underlying = calculateBigDecimal(msb, lsb); - - } - - private static long calculateMostSignificantBits(final BigDecimal underlying) - { - return 0; //TODO. - } - - private static long calculateLeastSignificantBits(final BigDecimal underlying) - { - return 0; //TODO. - } - - private static BigDecimal calculateBigDecimal(final long msb, final long lsb) - { - return BigDecimal.ZERO; //TODO. - } - - @Override - public int intValue() - { - return _underlying.intValue(); - } - - @Override - public long longValue() - { - return _underlying.longValue(); - } - - @Override - public float floatValue() - { - return _underlying.floatValue(); - } - - @Override - public double doubleValue() - { - return _underlying.doubleValue(); - } - - public long getMostSignificantBits() - { - return _msb; - } - - public long getLeastSignificantBits() - { - return _lsb; - } -}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/Decimal32.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/Decimal32.java b/proton-j/codec/src/org/apache/qpid/proton/type/Decimal32.java deleted file mode 100644 index 2dbd3a6..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/Decimal32.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -import java.math.BigDecimal; - -public class Decimal32 extends Number -{ - private final BigDecimal _underlying; - private final int _bits; - - public Decimal32(BigDecimal underlying) - { - _underlying = underlying; - _bits = calculateBits( underlying ); - } - - public Decimal32(final int bits) - { - _bits = bits; - _underlying = calculateBigDecimal(bits); - } - - static int calculateBits(final BigDecimal underlying) - { - return 0; //TODO. - } - - static BigDecimal calculateBigDecimal(int bits) - { - return BigDecimal.ZERO; // TODO - } - - - @Override - public int intValue() - { - return _underlying.intValue(); - } - - @Override - public long longValue() - { - return _underlying.longValue(); - } - - @Override - public float floatValue() - { - return _underlying.floatValue(); - } - - @Override - public double doubleValue() - { - return _underlying.doubleValue(); - } - - public int getBits() - { - return _bits; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/Decimal64.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/Decimal64.java b/proton-j/codec/src/org/apache/qpid/proton/type/Decimal64.java deleted file mode 100644 index 049666f..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/Decimal64.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -import java.math.BigDecimal; - -public class Decimal64 extends Number -{ - private final BigDecimal _underlying; - private final long _bits; - - public Decimal64(BigDecimal underlying) - { - _underlying = underlying; - _bits = calculateBits(underlying); - - } - - - public Decimal64(final long bits) - { - _bits = bits; - _underlying = calculateBigDecimal(bits); - } - - static BigDecimal calculateBigDecimal(final long bits) - { - return BigDecimal.ZERO; - } - - static long calculateBits(final BigDecimal underlying) - { - return 0l; // TODO - } - - - @Override - public int intValue() - { - return _underlying.intValue(); - } - - @Override - public long longValue() - { - return _underlying.longValue(); - } - - @Override - public float floatValue() - { - return _underlying.floatValue(); - } - - @Override - public double doubleValue() - { - return _underlying.doubleValue(); - } - - public long getBits() - { - return _bits; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/DescribedType.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/DescribedType.java b/proton-j/codec/src/org/apache/qpid/proton/type/DescribedType.java deleted file mode 100644 index 2aa2f55..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/DescribedType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.type; - -public interface DescribedType -{ - public Object getDescriptor(); - public Object getDescribed(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/Symbol.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/Symbol.java b/proton-j/codec/src/org/apache/qpid/proton/type/Symbol.java deleted file mode 100644 index 6c59c31..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/Symbol.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -import java.util.concurrent.ConcurrentHashMap; - -public final class Symbol implements Comparable<Symbol>, CharSequence -{ - private final String _underlying; - private static final ConcurrentHashMap<String, Symbol> _symbols = new ConcurrentHashMap<String, Symbol>(2048); - - private Symbol(String underlying) - { - _underlying = underlying; - } - - public int length() - { - return _underlying.length(); - } - - public int compareTo(Symbol o) - { - return _underlying.compareTo(o._underlying); - } - - public char charAt(int index) - { - return _underlying.charAt(index); - } - - public CharSequence subSequence(int beginIndex, int endIndex) - { - return _underlying.subSequence(beginIndex, endIndex); - } - - @Override - public String toString() - { - return _underlying; - } - - @Override - public int hashCode() - { - return _underlying.hashCode(); - } - - public static Symbol valueOf(String symbolVal) - { - return getSymbol(symbolVal); - } - - public static Symbol getSymbol(String symbolVal) - { - Symbol symbol = _symbols.get(symbolVal); - if(symbol == null) - { - symbolVal = symbolVal.intern(); - symbol = new Symbol(symbolVal); - Symbol existing; - if((existing = _symbols.putIfAbsent(symbolVal, symbol)) != null) - { - symbol = existing; - } - } - return symbol; - } - - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedByte.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedByte.java b/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedByte.java deleted file mode 100644 index 4d469d9..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedByte.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -public final class UnsignedByte extends Number implements Comparable<UnsignedByte> -{ - private final byte _underlying; - private static final UnsignedByte[] cachedValues = new UnsignedByte[256]; - - static - { - for(int i = 0; i<256; i++) - { - cachedValues[i] = new UnsignedByte((byte)i); - } - } - - public UnsignedByte(byte underlying) - { - _underlying = underlying; - } - - @Override - public byte byteValue() - { - return _underlying; - } - - @Override - public short shortValue() - { - return (short) intValue(); - } - - @Override - public int intValue() - { - return ((int)_underlying) & 0xFF; - } - - @Override - public long longValue() - { - return ((long) _underlying) & 0xFFl; - } - - @Override - public float floatValue() - { - return (float) longValue(); - } - - @Override - public double doubleValue() - { - return (double) longValue(); - } - - @Override - public boolean equals(Object o) - { - if (this == o) - { - return true; - } - if (o == null || getClass() != o.getClass()) - { - return false; - } - - UnsignedByte that = (UnsignedByte) o; - - if (_underlying != that._underlying) - { - return false; - } - - return true; - } - - public int compareTo(UnsignedByte o) - { - return Integer.signum(intValue() - o.intValue()); - } - - @Override - public int hashCode() - { - return _underlying; - } - - @Override - public String toString() - { - return String.valueOf(intValue()); - } - - public static UnsignedByte valueOf(byte underlying) - { - final int index = ((int) underlying) & 0xFF; - return cachedValues[index]; - } - - public static UnsignedByte valueOf(final String value) - throws NumberFormatException - { - int intVal = Integer.parseInt(value); - if(intVal < 0 || intVal >= (1<<8)) - { - throw new NumberFormatException("Value \""+value+"\" lies outside the range [" + 0 + "-" + (1<<8) +")."); - } - return valueOf((byte)intVal); - } - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedInteger.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedInteger.java b/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedInteger.java deleted file mode 100644 index 0360811..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedInteger.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -public final class UnsignedInteger extends Number implements Comparable<UnsignedInteger> -{ - private final int _underlying; - private static final UnsignedInteger[] cachedValues = new UnsignedInteger[256]; - - static - { - for(int i = 0; i < 256; i++) - { - cachedValues[i] = new UnsignedInteger(i); - } - } - - public static final UnsignedInteger ZERO = cachedValues[0]; - public static final UnsignedInteger ONE = cachedValues[1]; - public static final UnsignedInteger MAX_VALUE = new UnsignedInteger(0xffffffff); - - - public UnsignedInteger(int underlying) - { - _underlying = underlying; - } - - @Override - public int intValue() - { - return _underlying; - } - - @Override - public long longValue() - { - return ((long) _underlying) & 0xFFFFFFFFl; - } - - @Override - public float floatValue() - { - return (float) longValue(); - } - - @Override - public double doubleValue() - { - return (double) longValue(); - } - - @Override - public boolean equals(Object o) - { - if (this == o) - { - return true; - } - if (o == null || getClass() != o.getClass()) - { - return false; - } - - UnsignedInteger that = (UnsignedInteger) o; - - if (_underlying != that._underlying) - { - return false; - } - - return true; - } - - public int compareTo(UnsignedInteger o) - { - return Long.signum(longValue() - o.longValue()); - } - - @Override - public int hashCode() - { - return _underlying; - } - - @Override - public String toString() - { - return String.valueOf(longValue()); - } - - public static UnsignedInteger valueOf(int underlying) - { - if((underlying & 0xFFFFFF00) == 0) - { - return cachedValues[underlying]; - } - else - { - return new UnsignedInteger(underlying); - } - } - - public UnsignedInteger add(final UnsignedInteger i) - { - int val = _underlying + i._underlying; - return UnsignedInteger.valueOf(val); - } - - public UnsignedInteger subtract(final UnsignedInteger i) - { - int val = _underlying - i._underlying; - return UnsignedInteger.valueOf(val); - } - - public static UnsignedInteger valueOf(final String value) - { - long longVal = Long.parseLong(value); - return valueOf(longVal); - } - - public static UnsignedInteger valueOf(final long longVal) - { - if(longVal < 0L || longVal >= (1L<<32)) - { - throw new NumberFormatException("Value \""+longVal+"\" lies outside the range [" + 0L + "-" + (1L<<32) +")."); - } - return valueOf((int)longVal); - } - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedLong.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedLong.java b/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedLong.java deleted file mode 100644 index 3c10569..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedLong.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -import java.math.BigInteger; - -public final class UnsignedLong extends Number implements Comparable<UnsignedLong> -{ - private static final BigInteger TWO_TO_THE_SIXTY_FOUR = new BigInteger( new byte[] { (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 }); - private static final BigInteger LONG_MAX_VALUE = BigInteger.valueOf(Long.MAX_VALUE); - - private static final UnsignedLong[] cachedValues = new UnsignedLong[256]; - - static - { - for(int i = 0; i<256; i++) - { - cachedValues[i] = new UnsignedLong(i); - } - } - - public static final UnsignedLong ZERO = cachedValues[0]; - - private final long _underlying; - - - public UnsignedLong(long underlying) - { - _underlying = underlying; - } - - @Override - public int intValue() - { - return (int) _underlying; - } - - @Override - public long longValue() - { - return _underlying; - } - - public BigInteger bigIntegerValue() - { - if(_underlying >= 0L) - { - return BigInteger.valueOf(_underlying); - } - else - { - return TWO_TO_THE_SIXTY_FOUR.add(BigInteger.valueOf(_underlying)); - } - } - - @Override - public float floatValue() - { - return (float) longValue(); - } - - @Override - public double doubleValue() - { - return (double) longValue(); - } - - @Override - public boolean equals(Object o) - { - if (this == o) - { - return true; - } - if (o == null || getClass() != o.getClass()) - { - return false; - } - - UnsignedLong that = (UnsignedLong) o; - - if (_underlying != that._underlying) - { - return false; - } - - return true; - } - - public int compareTo(UnsignedLong o) - { - return bigIntegerValue().compareTo(o.bigIntegerValue()); - } - - @Override - public int hashCode() - { - return (int)(_underlying ^ (_underlying >>> 32)); - } - - @Override - public String toString() - { - return String.valueOf(bigIntegerValue()); - } - - public static UnsignedLong valueOf(long underlying) - { - if((underlying & 0xFFL) == underlying) - { - return cachedValues[(int)underlying]; - } - else - { - return new UnsignedLong(underlying); - } - } - - public static UnsignedLong valueOf(final String value) - { - BigInteger bigInt = new BigInteger(value); - if(bigInt.signum() == -1 || bigInt.bitCount()>64) - { - throw new NumberFormatException("Value \""+value+"\" lies outside the range [" + 0L + "- 2^64)."); - } - else if(bigInt.compareTo(LONG_MAX_VALUE)>=0) - { - return UnsignedLong.valueOf(bigInt.longValue()); - } - else - { - return UnsignedLong.valueOf(TWO_TO_THE_SIXTY_FOUR.subtract(bigInt).negate().longValue()); - } - - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedShort.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedShort.java b/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedShort.java deleted file mode 100644 index 9566dbf..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/UnsignedShort.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.type; - -public final class UnsignedShort extends Number implements Comparable<UnsignedShort> -{ - private final short _underlying; - private static final UnsignedShort[] cachedValues = new UnsignedShort[256]; - - public static final UnsignedShort MAX_VALUE = new UnsignedShort((short) -1); - - static - { - for(short i = 0; i < 256; i++) - { - cachedValues[i] = new UnsignedShort(i); - } - } - - public UnsignedShort(short underlying) - { - _underlying = underlying; - } - - public short shortValue() - { - return _underlying; - } - - @Override - public int intValue() - { - return _underlying & 0xFFFF; - } - - @Override - public long longValue() - { - return ((long) _underlying) & 0xFFFFl; - } - - @Override - public float floatValue() - { - return (float) intValue(); - } - - @Override - public double doubleValue() - { - return (double) intValue(); - } - - @Override - public boolean equals(Object o) - { - if (this == o) - { - return true; - } - if (o == null || getClass() != o.getClass()) - { - return false; - } - - UnsignedShort that = (UnsignedShort) o; - - if (_underlying != that._underlying) - { - return false; - } - - return true; - } - - public int compareTo(UnsignedShort o) - { - return Integer.signum(intValue() - o.intValue()); - } - - @Override - public int hashCode() - { - return _underlying; - } - - @Override - public String toString() - { - return String.valueOf(longValue()); - } - - public static UnsignedShort valueOf(short underlying) - { - if((underlying & 0xFF00) == 0) - { - return cachedValues[underlying]; - } - else - { - return new UnsignedShort(underlying); - } - } - - public static UnsignedShort valueOf(final String value) - { - int intVal = Integer.parseInt(value); - if(intVal < 0 || intVal >= (1<<16)) - { - throw new NumberFormatException("Value \""+value+"\" lies outside the range [" + 0 + "-" + (1<<16) +")."); - } - return valueOf((short)intVal); - - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Accepted.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Accepted.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Accepted.java deleted file mode 100644 index f3539e8..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Accepted.java +++ /dev/null @@ -1,114 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Accepted - implements DescribedType , org.apache.qpid.proton.type.transport.DeliveryState, Outcome -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000024L), Symbol.valueOf("amqp:accepted:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000024L); - private final AcceptedWrapper _wrapper = new AcceptedWrapper(); - - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 0; - - } - - - public final class AcceptedWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Accepted.this.get(index); - } - - @Override - public int size() - { - return Accepted.this.size(); - } - } - - private static class AcceptedConstructor implements DescribedTypeConstructor<Accepted> - { - public Accepted newInstance(Object described) - { - List l = (List) described; - - Accepted o = new Accepted(); - - - return o; - } - - public Class<Accepted> getTypeClass() - { - return Accepted.class; - } - } - - - public static void register(Decoder decoder) - { - AcceptedConstructor constructor = new AcceptedConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpSequence.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpSequence.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpSequence.java deleted file mode 100644 index 64605e6..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpSequence.java +++ /dev/null @@ -1,87 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class AmqpSequence - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000076L), Symbol.valueOf("amqp:amqp-sequence:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000076L); - private final List _value; - - public AmqpSequence(List value) - { - _value = value; - } - - public List getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class AmqpSequenceConstructor implements DescribedTypeConstructor<AmqpSequence> - { - public AmqpSequence newInstance(Object described) - { - return new AmqpSequence( (List) described ); - } - - public Class<AmqpSequence> getTypeClass() - { - return AmqpSequence.class; - } - } - - - public static void register(Decoder decoder) - { - AmqpSequenceConstructor constructor = new AmqpSequenceConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpValue.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpValue.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpValue.java deleted file mode 100644 index 5bf9241..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/AmqpValue.java +++ /dev/null @@ -1,86 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class AmqpValue - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000077L), Symbol.valueOf("amqp:amqp-value:*"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000077L); - private final Object _value; - - public AmqpValue(Object value) - { - _value = value; - } - - public Object getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class AmqpValueConstructor implements DescribedTypeConstructor<AmqpValue> - { - public AmqpValue newInstance(Object described) - { - return new AmqpValue( (Object) described ); - } - - public Class<AmqpValue> getTypeClass() - { - return AmqpValue.class; - } - } - - - public static void register(Decoder decoder) - { - AmqpValueConstructor constructor = new AmqpValueConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/ApplicationProperties.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/ApplicationProperties.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/ApplicationProperties.java deleted file mode 100644 index 05b1921..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/ApplicationProperties.java +++ /dev/null @@ -1,87 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.Map; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class ApplicationProperties - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000074L), Symbol.valueOf("amqp:application-properties:map"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000074L); - private final Map _value; - - public ApplicationProperties(Map value) - { - _value = value; - } - - public Map getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class ApplicationPropertiesConstructor implements DescribedTypeConstructor<ApplicationProperties> - { - public ApplicationProperties newInstance(Object described) - { - return new ApplicationProperties( (Map) described ); - } - - public Class<ApplicationProperties> getTypeClass() - { - return ApplicationProperties.class; - } - } - - - public static void register(Decoder decoder) - { - ApplicationPropertiesConstructor constructor = new ApplicationPropertiesConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Data.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Data.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Data.java deleted file mode 100644 index d3cb446..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Data.java +++ /dev/null @@ -1,86 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Data - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000075L), Symbol.valueOf("amqp:data:binary"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000075L); - private final Binary _value; - - public Data(Binary value) - { - _value = value; - } - - public Binary getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class DataConstructor implements DescribedTypeConstructor<Data> - { - public Data newInstance(Object described) - { - return new Data( (Binary) described ); - } - - public Class<Data> getTypeClass() - { - return Data.class; - } - } - - - public static void register(Decoder decoder) - { - DataConstructor constructor = new DataConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnClose.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnClose.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnClose.java deleted file mode 100644 index 97c1b99..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnClose.java +++ /dev/null @@ -1,114 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class DeleteOnClose - implements DescribedType , LifetimePolicy -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x000000000000002bL), Symbol.valueOf("amqp:delete-on-close:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x000000000000002bL); - private final DeleteOnCloseWrapper _wrapper = new DeleteOnCloseWrapper(); - - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 0; - - } - - - public final class DeleteOnCloseWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return DeleteOnClose.this.get(index); - } - - @Override - public int size() - { - return DeleteOnClose.this.size(); - } - } - - private static class DeleteOnCloseConstructor implements DescribedTypeConstructor<DeleteOnClose> - { - public DeleteOnClose newInstance(Object described) - { - List l = (List) described; - - DeleteOnClose o = new DeleteOnClose(); - - - return o; - } - - public Class<DeleteOnClose> getTypeClass() - { - return DeleteOnClose.class; - } - } - - - public static void register(Decoder decoder) - { - DeleteOnCloseConstructor constructor = new DeleteOnCloseConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinks.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinks.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinks.java deleted file mode 100644 index 6ce2d75..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinks.java +++ /dev/null @@ -1,114 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class DeleteOnNoLinks - implements DescribedType , LifetimePolicy -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x000000000000002cL), Symbol.valueOf("amqp:delete-on-no-links:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x000000000000002cL); - private final DeleteOnNoLinksWrapper _wrapper = new DeleteOnNoLinksWrapper(); - - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 0; - - } - - - public final class DeleteOnNoLinksWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return DeleteOnNoLinks.this.get(index); - } - - @Override - public int size() - { - return DeleteOnNoLinks.this.size(); - } - } - - private static class DeleteOnNoLinksConstructor implements DescribedTypeConstructor<DeleteOnNoLinks> - { - public DeleteOnNoLinks newInstance(Object described) - { - List l = (List) described; - - DeleteOnNoLinks o = new DeleteOnNoLinks(); - - - return o; - } - - public Class<DeleteOnNoLinks> getTypeClass() - { - return DeleteOnNoLinks.class; - } - } - - - public static void register(Decoder decoder) - { - DeleteOnNoLinksConstructor constructor = new DeleteOnNoLinksConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinksOrMessages.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinksOrMessages.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinksOrMessages.java deleted file mode 100644 index 8a11642..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoLinksOrMessages.java +++ /dev/null @@ -1,114 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class DeleteOnNoLinksOrMessages - implements DescribedType , LifetimePolicy -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x000000000000002eL), Symbol.valueOf("amqp:delete-on-no-links-or-messages:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x000000000000002eL); - private final DeleteOnNoLinksOrMessagesWrapper _wrapper = new DeleteOnNoLinksOrMessagesWrapper(); - - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 0; - - } - - - public final class DeleteOnNoLinksOrMessagesWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return DeleteOnNoLinksOrMessages.this.get(index); - } - - @Override - public int size() - { - return DeleteOnNoLinksOrMessages.this.size(); - } - } - - private static class DeleteOnNoLinksOrMessagesConstructor implements DescribedTypeConstructor<DeleteOnNoLinksOrMessages> - { - public DeleteOnNoLinksOrMessages newInstance(Object described) - { - List l = (List) described; - - DeleteOnNoLinksOrMessages o = new DeleteOnNoLinksOrMessages(); - - - return o; - } - - public Class<DeleteOnNoLinksOrMessages> getTypeClass() - { - return DeleteOnNoLinksOrMessages.class; - } - } - - - public static void register(Decoder decoder) - { - DeleteOnNoLinksOrMessagesConstructor constructor = new DeleteOnNoLinksOrMessagesConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoMessages.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoMessages.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoMessages.java deleted file mode 100644 index 26f6dbe..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeleteOnNoMessages.java +++ /dev/null @@ -1,114 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class DeleteOnNoMessages - implements DescribedType , LifetimePolicy -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x000000000000002dL), Symbol.valueOf("amqp:delete-on-no-messages:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x000000000000002dL); - private final DeleteOnNoMessagesWrapper _wrapper = new DeleteOnNoMessagesWrapper(); - - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return 0; - - } - - - public final class DeleteOnNoMessagesWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return DeleteOnNoMessages.this.get(index); - } - - @Override - public int size() - { - return DeleteOnNoMessages.this.size(); - } - } - - private static class DeleteOnNoMessagesConstructor implements DescribedTypeConstructor<DeleteOnNoMessages> - { - public DeleteOnNoMessages newInstance(Object described) - { - List l = (List) described; - - DeleteOnNoMessages o = new DeleteOnNoMessages(); - - - return o; - } - - public Class<DeleteOnNoMessages> getTypeClass() - { - return DeleteOnNoMessages.class; - } - } - - - public static void register(Decoder decoder) - { - DeleteOnNoMessagesConstructor constructor = new DeleteOnNoMessagesConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeliveryAnnotations.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeliveryAnnotations.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeliveryAnnotations.java deleted file mode 100644 index 7539c80..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/DeliveryAnnotations.java +++ /dev/null @@ -1,87 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.Map; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class DeliveryAnnotations - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000071L), Symbol.valueOf("amqp:delivery-annotations:map"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000071L); - private final Map _value; - - public DeliveryAnnotations(Map value) - { - _value = value; - } - - public Map getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class DeliveryAnnotationsConstructor implements DescribedTypeConstructor<DeliveryAnnotations> - { - public DeliveryAnnotations newInstance(Object described) - { - return new DeliveryAnnotations( (Map) described ); - } - - public Class<DeliveryAnnotations> getTypeClass() - { - return DeliveryAnnotations.class; - } - } - - - public static void register(Decoder decoder) - { - DeliveryAnnotationsConstructor constructor = new DeliveryAnnotationsConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Footer.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Footer.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Footer.java deleted file mode 100644 index 75de3a1..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Footer.java +++ /dev/null @@ -1,87 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.Map; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Footer - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000078L), Symbol.valueOf("amqp:footer:map"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000078L); - private final Map _value; - - public Footer(Map value) - { - _value = value; - } - - public Map getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class FooterConstructor implements DescribedTypeConstructor<Footer> - { - public Footer newInstance(Object described) - { - return new Footer( (Map) described ); - } - - public Class<Footer> getTypeClass() - { - return Footer.class; - } - } - - - public static void register(Decoder decoder) - { - FooterConstructor constructor = new FooterConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Header.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Header.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Header.java deleted file mode 100644 index 7cc7d9e..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Header.java +++ /dev/null @@ -1,209 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Header - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000070L), Symbol.valueOf("amqp:header:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000070L); - private final HeaderWrapper _wrapper = new HeaderWrapper(); - - private Boolean _durable; - private UnsignedByte _priority; - private UnsignedInteger _ttl; - private Boolean _firstAcquirer; - private UnsignedInteger _deliveryCount; - - public Boolean getDurable() - { - return _durable; - } - - public void setDurable(Boolean durable) - { - _durable = durable; - } - - public UnsignedByte getPriority() - { - return _priority; - } - - public void setPriority(UnsignedByte priority) - { - _priority = priority; - } - - public UnsignedInteger getTtl() - { - return _ttl; - } - - public void setTtl(UnsignedInteger ttl) - { - _ttl = ttl; - } - - public Boolean getFirstAcquirer() - { - return _firstAcquirer; - } - - public void setFirstAcquirer(Boolean firstAcquirer) - { - _firstAcquirer = firstAcquirer; - } - - public UnsignedInteger getDeliveryCount() - { - return _deliveryCount; - } - - public void setDeliveryCount(UnsignedInteger deliveryCount) - { - _deliveryCount = deliveryCount; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _durable; - case 1: - return _priority; - case 2: - return _ttl; - case 3: - return _firstAcquirer; - case 4: - return _deliveryCount; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _deliveryCount != null - ? 5 - : _firstAcquirer != null - ? 4 - : _ttl != null - ? 3 - : _priority != null - ? 2 - : _durable != null - ? 1 - : 0; - - } - - - public final class HeaderWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Header.this.get(index); - } - - @Override - public int size() - { - return Header.this.size(); - } - } - - private static class HeaderConstructor implements DescribedTypeConstructor<Header> - { - public Header newInstance(Object described) - { - List l = (List) described; - - Header o = new Header(); - - - switch(5 - l.size()) - { - - case 0: - o.setDeliveryCount( (UnsignedInteger) l.get( 4 ) ); - case 1: - o.setFirstAcquirer( (Boolean) l.get( 3 ) ); - case 2: - o.setTtl( (UnsignedInteger) l.get( 2 ) ); - case 3: - o.setPriority( (UnsignedByte) l.get( 1 ) ); - case 4: - o.setDurable( (Boolean) l.get( 0 ) ); - } - - - return o; - } - - public Class<Header> getTypeClass() - { - return Header.class; - } - } - - - public static void register(Decoder decoder) - { - HeaderConstructor constructor = new HeaderConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/LifetimePolicy.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/LifetimePolicy.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/LifetimePolicy.java deleted file mode 100644 index 8fde14c..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/LifetimePolicy.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.type.messaging; - -public interface LifetimePolicy -{ -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/MessageAnnotations.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/MessageAnnotations.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/MessageAnnotations.java deleted file mode 100644 index 31a2201..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/MessageAnnotations.java +++ /dev/null @@ -1,87 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.Map; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class MessageAnnotations - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000072L), Symbol.valueOf("amqp:message-annotations:map"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000072L); - private final Map _value; - - public MessageAnnotations(Map value) - { - _value = value; - } - - public Map getValue() - { - return _value; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _value; - } - - private static class MessageAnnotationsConstructor implements DescribedTypeConstructor<MessageAnnotations> - { - public MessageAnnotations newInstance(Object described) - { - return new MessageAnnotations( (Map) described ); - } - - public Class<MessageAnnotations> getTypeClass() - { - return MessageAnnotations.class; - } - } - - - public static void register(Decoder decoder) - { - MessageAnnotationsConstructor constructor = new MessageAnnotationsConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Modified.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Modified.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Modified.java deleted file mode 100644 index bb49a58..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Modified.java +++ /dev/null @@ -1,176 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.Map; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Modified - implements DescribedType , org.apache.qpid.proton.type.transport.DeliveryState, Outcome -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000027L), Symbol.valueOf("amqp:modified:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000027L); - private final ModifiedWrapper _wrapper = new ModifiedWrapper(); - - private Boolean _deliveryFailed; - private Boolean _undeliverableHere; - private Map _messageAnnotations; - - public Boolean getDeliveryFailed() - { - return _deliveryFailed; - } - - public void setDeliveryFailed(Boolean deliveryFailed) - { - _deliveryFailed = deliveryFailed; - } - - public Boolean getUndeliverableHere() - { - return _undeliverableHere; - } - - public void setUndeliverableHere(Boolean undeliverableHere) - { - _undeliverableHere = undeliverableHere; - } - - public Map getMessageAnnotations() - { - return _messageAnnotations; - } - - public void setMessageAnnotations(Map messageAnnotations) - { - _messageAnnotations = messageAnnotations; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _deliveryFailed; - case 1: - return _undeliverableHere; - case 2: - return _messageAnnotations; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _messageAnnotations != null - ? 3 - : _undeliverableHere != null - ? 2 - : _deliveryFailed != null - ? 1 - : 0; - - } - - - public final class ModifiedWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Modified.this.get(index); - } - - @Override - public int size() - { - return Modified.this.size(); - } - } - - private static class ModifiedConstructor implements DescribedTypeConstructor<Modified> - { - public Modified newInstance(Object described) - { - List l = (List) described; - - Modified o = new Modified(); - - - switch(3 - l.size()) - { - - case 0: - o.setMessageAnnotations( (Map) l.get( 2 ) ); - case 1: - o.setUndeliverableHere( (Boolean) l.get( 1 ) ); - case 2: - o.setDeliveryFailed( (Boolean) l.get( 0 ) ); - } - - - return o; - } - - public Class<Modified> getTypeClass() - { - return Modified.class; - } - } - - - public static void register(Decoder decoder) - { - ModifiedConstructor constructor = new ModifiedConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Outcome.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Outcome.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Outcome.java deleted file mode 100644 index 17ecd84..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Outcome.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.apache.qpid.proton.type.messaging; - -public interface Outcome -{ -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Properties.java ---------------------------------------------------------------------- diff --git a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Properties.java b/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Properties.java deleted file mode 100644 index e0d22bd..0000000 --- a/proton-j/codec/src/org/apache/qpid/proton/type/messaging/Properties.java +++ /dev/null @@ -1,346 +0,0 @@ - -/* -* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -* -*/ - - -package org.apache.qpid.proton.type.messaging; -import java.util.Date; -import java.util.List; -import java.util.AbstractList; - - -import org.apache.qpid.proton.codec.Decoder; -import org.apache.qpid.proton.codec.DescribedTypeConstructor; -import org.apache.qpid.proton.type.*; - - -public class Properties - implements DescribedType , Section -{ - private static final Object[] DESCRIPTORS = - { - UnsignedLong.valueOf(0x0000000000000073L), Symbol.valueOf("amqp:properties:list"), - }; - - private static final UnsignedLong DESCRIPTOR = UnsignedLong.valueOf(0x0000000000000073L); - private final PropertiesWrapper _wrapper = new PropertiesWrapper(); - - private Object _messageId; - private Binary _userId; - private String _to; - private String _subject; - private String _replyTo; - private Object _correlationId; - private Symbol _contentType; - private Symbol _contentEncoding; - private Date _absoluteExpiryTime; - private Date _creationTime; - private String _groupId; - private UnsignedInteger _groupSequence; - private String _replyToGroupId; - - public Object getMessageId() - { - return _messageId; - } - - public void setMessageId(Object messageId) - { - _messageId = messageId; - } - - public Binary getUserId() - { - return _userId; - } - - public void setUserId(Binary userId) - { - _userId = userId; - } - - public String getTo() - { - return _to; - } - - public void setTo(String to) - { - _to = to; - } - - public String getSubject() - { - return _subject; - } - - public void setSubject(String subject) - { - _subject = subject; - } - - public String getReplyTo() - { - return _replyTo; - } - - public void setReplyTo(String replyTo) - { - _replyTo = replyTo; - } - - public Object getCorrelationId() - { - return _correlationId; - } - - public void setCorrelationId(Object correlationId) - { - _correlationId = correlationId; - } - - public Symbol getContentType() - { - return _contentType; - } - - public void setContentType(Symbol contentType) - { - _contentType = contentType; - } - - public Symbol getContentEncoding() - { - return _contentEncoding; - } - - public void setContentEncoding(Symbol contentEncoding) - { - _contentEncoding = contentEncoding; - } - - public Date getAbsoluteExpiryTime() - { - return _absoluteExpiryTime; - } - - public void setAbsoluteExpiryTime(Date absoluteExpiryTime) - { - _absoluteExpiryTime = absoluteExpiryTime; - } - - public Date getCreationTime() - { - return _creationTime; - } - - public void setCreationTime(Date creationTime) - { - _creationTime = creationTime; - } - - public String getGroupId() - { - return _groupId; - } - - public void setGroupId(String groupId) - { - _groupId = groupId; - } - - public UnsignedInteger getGroupSequence() - { - return _groupSequence; - } - - public void setGroupSequence(UnsignedInteger groupSequence) - { - _groupSequence = groupSequence; - } - - public String getReplyToGroupId() - { - return _replyToGroupId; - } - - public void setReplyToGroupId(String replyToGroupId) - { - _replyToGroupId = replyToGroupId; - } - - public Object getDescriptor() - { - return DESCRIPTOR; - } - - public Object getDescribed() - { - return _wrapper; - } - - public Object get(final int index) - { - - switch(index) - { - case 0: - return _messageId; - case 1: - return _userId; - case 2: - return _to; - case 3: - return _subject; - case 4: - return _replyTo; - case 5: - return _correlationId; - case 6: - return _contentType; - case 7: - return _contentEncoding; - case 8: - return _absoluteExpiryTime; - case 9: - return _creationTime; - case 10: - return _groupId; - case 11: - return _groupSequence; - case 12: - return _replyToGroupId; - } - - throw new IllegalStateException("Unknown index " + index); - - } - - public int size() - { - return _replyToGroupId != null - ? 13 - : _groupSequence != null - ? 12 - : _groupId != null - ? 11 - : _creationTime != null - ? 10 - : _absoluteExpiryTime != null - ? 9 - : _contentEncoding != null - ? 8 - : _contentType != null - ? 7 - : _correlationId != null - ? 6 - : _replyTo != null - ? 5 - : _subject != null - ? 4 - : _to != null - ? 3 - : _userId != null - ? 2 - : _messageId != null - ? 1 - : 0; - - } - - - public final class PropertiesWrapper extends AbstractList - { - - @Override - public Object get(final int index) - { - return Properties.this.get(index); - } - - @Override - public int size() - { - return Properties.this.size(); - } - } - - private static class PropertiesConstructor implements DescribedTypeConstructor<Properties> - { - public Properties newInstance(Object described) - { - List l = (List) described; - - Properties o = new Properties(); - - - switch(13 - l.size()) - { - - case 0: - o.setReplyToGroupId( (String) l.get( 12 ) ); - case 1: - o.setGroupSequence( (UnsignedInteger) l.get( 11 ) ); - case 2: - o.setGroupId( (String) l.get( 10 ) ); - case 3: - o.setCreationTime( (Date) l.get( 9 ) ); - case 4: - o.setAbsoluteExpiryTime( (Date) l.get( 8 ) ); - case 5: - o.setContentEncoding( (Symbol) l.get( 7 ) ); - case 6: - o.setContentType( (Symbol) l.get( 6 ) ); - case 7: - o.setCorrelationId( (Object) l.get( 5 ) ); - case 8: - o.setReplyTo( (String) l.get( 4 ) ); - case 9: - o.setSubject( (String) l.get( 3 ) ); - case 10: - o.setTo( (String) l.get( 2 ) ); - case 11: - o.setUserId( (Binary) l.get( 1 ) ); - case 12: - o.setMessageId( (Object) l.get( 0 ) ); - } - - - return o; - } - - public Class<Properties> getTypeClass() - { - return Properties.class; - } - } - - - public static void register(Decoder decoder) - { - PropertiesConstructor constructor = new PropertiesConstructor(); - for(Object descriptor : DESCRIPTORS) - { - decoder.register(descriptor, constructor); - } - } -} - \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
