org.chromium.sdk/src/org/chromium/sdk/UnsupportedVersionException.java
changeset 2 e4420d2515f1
equal deleted inserted replaced
1:ef76fc2ac88c 2:e4420d2515f1
       
     1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
       
     2 // Use of this source code is governed by a BSD-style license that can be
       
     3 // found in the LICENSE file.
       
     4 
       
     5 package org.chromium.sdk;
       
     6 
       
     7 /**
       
     8  * This exception is thrown if the SDK protocol version is not compatible with
       
     9  * that supported by the browser.
       
    10  */
       
    11 public class UnsupportedVersionException extends Exception {
       
    12 
       
    13   private static final long serialVersionUID = 1L;
       
    14   private final Version localVersion;
       
    15   private final Version remoteVersion;
       
    16 
       
    17   public UnsupportedVersionException(Version localVersion, Version remoteVersion) {
       
    18     this(localVersion, remoteVersion, "localVersion=" + localVersion
       
    19         + "; remoteVersion=" + remoteVersion);
       
    20   }
       
    21 
       
    22   public UnsupportedVersionException(Version localVersion, Version remoteVersion, String message) {
       
    23     super(message);
       
    24     this.localVersion = localVersion;
       
    25     this.remoteVersion = remoteVersion;
       
    26   }
       
    27 
       
    28   /**
       
    29    * @return the protocol version supported by the SDK
       
    30    */
       
    31   public Version getLocalVersion() {
       
    32     return localVersion;
       
    33   }
       
    34 
       
    35   /**
       
    36    * @return the incompatible protocol version supported by the browser
       
    37    */
       
    38   public Version getRemoteVersion() {
       
    39     return remoteVersion;
       
    40   }
       
    41 }