01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client.rpc;
17:
18: import com.google.gwt.user.client.rpc.CustomFieldSerializerTestSetFactory.SerializableSubclass;
19:
20: /**
21: * Data validator used by the
22: * {@link com.google.gwt.user.client.rpc.CustomFieldSerializerTest CustomFieldSerializerTest}
23: * unit test.
24: */
25: public class CustomFieldSerializerTestSetValidator {
26: public static boolean isValid(
27: ManuallySerializedClass manuallySerializedClass) {
28: if (manuallySerializedClass == null) {
29: return false;
30: }
31:
32: return manuallySerializedClass.getA() == 4
33: && manuallySerializedClass.getB() == 5
34: && manuallySerializedClass.getC() == 6
35: && manuallySerializedClass.getObj().equals("bye");
36: }
37:
38: public static boolean isValid(
39: SerializableSubclass serializableSubclass) {
40: if (serializableSubclass == null) {
41: return false;
42: }
43:
44: if (serializableSubclass.getD() != 4) {
45: return false;
46: }
47:
48: return isValid((ManuallySerializedClass) serializableSubclass);
49: }
50: }
|