Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *    http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 package org.apache.spark.util.kvstore;
0019 
0020 public class CustomType1 {
0021 
0022   @KVIndex
0023   public String key;
0024 
0025   @KVIndex("id")
0026   public String id;
0027 
0028   @KVIndex(value = "name", copy = true)
0029   public String name;
0030 
0031   @KVIndex("int")
0032   public int num;
0033 
0034   @KVIndex(value = "child", parent = "id")
0035   public String child;
0036 
0037   @Override
0038   public boolean equals(Object o) {
0039     if (o instanceof CustomType1) {
0040       CustomType1 other = (CustomType1) o;
0041       return id.equals(other.id) && name.equals(other.name);
0042     }
0043     return false;
0044   }
0045 
0046   @Override
0047   public int hashCode() {
0048     return id.hashCode();
0049   }
0050 
0051   @Override
0052   public String toString() {
0053     return "CustomType1[key=" + key + ",id=" + id + ",name=" + name + ",num=" + num;
0054   }
0055 
0056 }