From 0c633b78d0c5784e4261b3ab0cefd3e016d9940d Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Wed, 19 Nov 2008 13:36:22 +0000 Subject: QPID-1463: Andrea's patches - Added 6 data types (Int8, Int16, Int32, Int64, Double and Float); git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@718957 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/management/domain/model/type/Double.java | 44 ++++++++++++++++++++++ .../qpid/management/domain/model/type/Float.java | 44 ++++++++++++++++++++++ .../qpid/management/domain/model/type/Int16.java | 44 ++++++++++++++++++++++ .../qpid/management/domain/model/type/Int32.java | 44 ++++++++++++++++++++++ .../qpid/management/domain/model/type/Int64.java | 44 ++++++++++++++++++++++ .../qpid/management/domain/model/type/Int8.java | 44 ++++++++++++++++++++++ 6 files changed, 264 insertions(+) create mode 100644 java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java create mode 100644 java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java create mode 100644 java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java create mode 100644 java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java create mode 100644 java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java create mode 100644 java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java (limited to 'java/management/client/src') diff --git a/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java new file mode 100644 index 0000000000..d36af3d3df --- /dev/null +++ b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java @@ -0,0 +1,44 @@ +/* + * + * 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.management.domain.model.type; + +import org.apache.qpid.transport.codec.Decoder; +import org.apache.qpid.transport.codec.Encoder; + +public class Double extends Type +{ + public Double() + { + super(java.lang.Double.class); + } + + @Override + public Object decode(Decoder decoder) + { + return decoder.readDouble(); + } + + @Override + public void encode(Object value, Encoder encoder) + { + encoder.writeDouble((java.lang.Double)value); + } +} diff --git a/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java new file mode 100644 index 0000000000..cb1f6e78a7 --- /dev/null +++ b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java @@ -0,0 +1,44 @@ +/* + * + * 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.management.domain.model.type; + +import org.apache.qpid.transport.codec.Decoder; +import org.apache.qpid.transport.codec.Encoder; + +public class Float extends Type +{ + public Float() + { + super(java.lang.Float.class); + } + + @Override + public Object decode(Decoder decoder) + { + return decoder.readFloat(); + } + + @Override + public void encode(Object value, Encoder encoder) + { + encoder.writeFloat((java.lang.Float)value); + } +} diff --git a/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java new file mode 100644 index 0000000000..f4685f0295 --- /dev/null +++ b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java @@ -0,0 +1,44 @@ +/* + * + * 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.management.domain.model.type; + +import org.apache.qpid.transport.codec.Decoder; +import org.apache.qpid.transport.codec.Encoder; + +public class Int16 extends Type +{ + public Int16() + { + super(Short.class); + } + + @Override + public Object decode (Decoder decoder) + { + return decoder.readInt16(); + } + + @Override + public void encode (Object value, Encoder encoder) + { + encoder.writeInt16((Short)value); + } +} \ No newline at end of file diff --git a/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java new file mode 100644 index 0000000000..ae5be90a2d --- /dev/null +++ b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java @@ -0,0 +1,44 @@ +/* + * + * 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.management.domain.model.type; + +import org.apache.qpid.transport.codec.Decoder; +import org.apache.qpid.transport.codec.Encoder; + +public class Int32 extends Type +{ + public Int32() + { + super(Integer.class); + } + + @Override + public Object decode (Decoder decoder) + { + return decoder.readInt32(); + } + + @Override + public void encode (Object value, Encoder encoder) + { + encoder.writeInt32((Integer)value); + } +} \ No newline at end of file diff --git a/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java new file mode 100644 index 0000000000..f76818344e --- /dev/null +++ b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java @@ -0,0 +1,44 @@ +/* + * + * 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.management.domain.model.type; + +import org.apache.qpid.transport.codec.Decoder; +import org.apache.qpid.transport.codec.Encoder; + +public class Int64 extends Type +{ + public Int64() + { + super(Long.class); + } + + @Override + public Object decode (Decoder decoder) + { + return decoder.readInt64(); + } + + @Override + public void encode (Object value, Encoder encoder) + { + encoder.writeInt64((Long)value); + } +} \ No newline at end of file diff --git a/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java new file mode 100644 index 0000000000..6f7c3b24d0 --- /dev/null +++ b/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java @@ -0,0 +1,44 @@ +/* + * + * 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.management.domain.model.type; + +import org.apache.qpid.transport.codec.Decoder; +import org.apache.qpid.transport.codec.Encoder; + +public class Int8 extends Type +{ + public Int8() + { + super(Byte.class); + } + + @Override + public Object decode (Decoder decoder) + { + return decoder.readInt8(); + } + + @Override + public void encode (Object value, Encoder encoder) + { + encoder.writeInt8((Byte)value); + } +} \ No newline at end of file -- cgit v1.2.1