KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > nutch > io > VersionMismatchException


1 /* Copyright (c) 2003 The Nutch Organization. All rights reserved. */
2 /* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */
3
4 package net.nutch.io;
5
6 import java.io.IOException JavaDoc;
7
8 /** Thrown by {@link VersionedWritable#readFields(DataInput)} when the
9  * version of an object being read does not match the current implementation
10  * version as returned by {@link VersionedWritable#getVersion()}. */

11 public class VersionMismatchException extends IOException JavaDoc {
12
13   private byte expectedVersion;
14   private byte foundVersion;
15
16   public VersionMismatchException(byte expectedVersionIn, byte foundVersionIn){
17     expectedVersion = expectedVersionIn;
18     foundVersion = foundVersionIn;
19   }
20
21   /** Returns a string representation of this object. */
22   public String JavaDoc toString(){
23     return "A record version mismatch occured. Expecting v"
24       + expectedVersion + ", found v" + foundVersion;
25   }
26 }
27
Popular Tags