⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testserial.java

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 JAVA
字号:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000,2007 Oracle.  All rights reserved. * * $Id: TestSerial.java,v 12.5 2007/05/04 00:28:29 mark Exp $ */package com.sleepycat.collections.test.serial;/** * @see StoredClassCatalogTest * @author Mark Hayes */class TestSerial implements java.io.Serializable {    static final long serialVersionUID = -3738980000390384920L;    private int i = 123;    private TestSerial other;    // The following field 's' was added after this class was compiled and    // serialized instances were saved in resource files.  This allows testing    // that the original stored instances can be deserialized after changing    // the class.  The serialVersionUID is needed for this according to Java    // serialization rules, and was generated with the serialver tool.    //    private String s = "string";    TestSerial(TestSerial other) {        this.other = other;    }    TestSerial getOther() {        return other;    }    int getIntField() {        return i;    }    String getStringField() {        return s; // this returned null before field 's' was added.    }    public boolean equals(Object object) {        try {            TestSerial o = (TestSerial) object;            if ((o.other == null) ? (this.other != null)                                  : (!o.other.equals(this.other))) {                return false;            }            if (this.i != o.i) {                return false;            }            // the following test was not done before field 's' was added            if ((o.s == null) ? (this.s != null)                              : (!o.s.equals(this.s))) {                return false;            }            return true;        } catch (ClassCastException e) {            return false;        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -