forked from hazelcast/hazelcast-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference_objects.go
75 lines (64 loc) · 2.95 KB
/
reference_objects.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
//
// Licensed 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 compatibility
import "github.com/ahmetmircik/hazelcast-go-client/serialization"
const (
// PORTABLE IDS
portableFactoryID = 1
portableClassID = 1
innerPortableClassID = 2
// IDENTIFIED DATA SERIALIZABLE IDS
identifiedDataSerializableFactoryID = 1
dataSerializableClassID = 1
// CUSTOM SERIALIZER IDS
// customStreamSerializableID = 1
// customByteArraySerializableID = 2
)
func getAllTestObjects() []interface{} {
var aNullObject interface{}
var aBoolean = true
var aByte byte = 113
var aChar uint16 = 'x'
var aDouble = -897543.3678909
var aShort int16 = -500
var aFloat float32 = 900.5678
var anInt int32 = 56789
var aLong int64 = -50992225
var aString = "Pijamalı hasta, yağız şoföre çabucak güvendi.イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラムThe quick brown fox jumps over the lazy dog"
var booleans = []bool{true, false, true}
// byte is signed in Java but unsigned in Go!
var bytes = []byte{112, 4, 255, 4, 112, 221, 43}
var chars = []uint16{'a', 'b', 'c'}
var doubles = []float64{-897543.3678909, 11.1, 22.2, 33.3}
var shorts = []int16{-500, 2, 3}
var floats = []float32{900.5678, 1.0, 2.1, 3.4}
var ints = []int32{56789, 2, 3}
var longs = []int64{-50992225, 1231232141, 2, 3}
w1 := "Pijamalı hasta, yağız şoföre çabucak güvendi."
w2 := "イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム"
w3 := "The quick brown fox jumps over the lazy dog"
var strings = []string{w1, w2, w3}
anInnerPortable := &AnInnerPortable{anInt, aFloat}
var portables = []serialization.Portable{anInnerPortable, anInnerPortable, anInnerPortable}
anIdentified := &anIdentifiedDataSerializable{aBoolean, aByte, aChar, aDouble, aShort, aFloat, anInt, aLong, aString,
booleans, bytes, chars, doubles, shorts, floats, ints, longs, strings,
nil, nil, nil, nil, nil, nil, nil, nil, nil, anInnerPortable,
nil}
aPortable := &aPortable{aBoolean, aByte, aChar, aDouble, aShort, aFloat, anInt, aLong, aString, anInnerPortable,
booleans, bytes, chars, doubles, shorts, floats, ints, longs, strings, portables, nil, nil,
nil, nil, nil, nil, nil, nil, nil}
return []interface{}{aNullObject, aBoolean, aByte, aChar, aDouble, aShort, aFloat, anInt, aLong, aString, anInnerPortable,
booleans, bytes, chars, doubles, shorts, floats, ints, longs, strings,
anIdentified, aPortable}
}