Tabnine Logo
HttpVersion.getMajor
Code IndexAdd Tabnine to your IDE (free)

How to use
getMajor
method
in
org.apache.commons.httpclient.HttpVersion

Best Java code snippets using org.apache.commons.httpclient.HttpVersion.getMajor (Showing top 7 results out of 315)

origin: commons-httpclient/commons-httpclient

/**
 * Compares this HTTP protocol version with another one.
 * 
 * @param anotherVer the version to be compared with.
 *  
 * @return a negative integer, zero, or a positive integer as this version is less than, 
 *    equal to, or greater than the specified version.     
 */
public int compareTo(HttpVersion anotherVer) {
  if (anotherVer == null) {
    throw new IllegalArgumentException("Version parameter may not be null"); 
  }
  int delta = getMajor() - anotherVer.getMajor();
  if (delta == 0) {
    delta = getMinor() - anotherVer.getMinor();
  }
  return delta;
}
origin: foxinmy/weixin4j

@Override
public HttpVersion getProtocol() {
  org.apache.commons.httpclient.HttpVersion version = httpMethod
      .getParams().getVersion();
  if (version == null) {
    return null;
  }
  Header connection = httpMethod.getResponseHeader("Connection");
  if (protocol == null) {
    protocol = new HttpVersion("HTTP", version.getMajor(),
        version.getMinor(), connection != null
            && KEEP_ALIVE.equalsIgnoreCase(connection
                .getValue()));
  }
  return protocol;
}
origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Compares this HTTP protocol version with another one.
 * 
 * @param anotherVer the version to be compared with.
 *  
 * @return a negative integer, zero, or a positive integer as this version is less than, 
 *    equal to, or greater than the specified version.     
 */
public int compareTo(HttpVersion anotherVer) {
  if (anotherVer == null) {
    throw new IllegalArgumentException("Version parameter may not be null"); 
  }
  int delta = getMajor() - anotherVer.getMajor();
  if (delta == 0) {
    delta = getMinor() - anotherVer.getMinor();
  }
  return delta;
}
origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Compares this HTTP protocol version with another one.
 * 
 * @param anotherVer the version to be compared with.
 *  
 * @return a negative integer, zero, or a positive integer as this version is less than, 
 *    equal to, or greater than the specified version.     
 */
public int compareTo(HttpVersion anotherVer) {
  if (anotherVer == null) {
    throw new IllegalArgumentException("Version parameter may not be null"); 
  }
  int delta = getMajor() - anotherVer.getMajor();
  if (delta == 0) {
    delta = getMinor() - anotherVer.getMinor();
  }
  return delta;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Compares this HTTP protocol version with another one.
 * 
 * @param anotherVer the version to be compared with.
 *  
 * @return a negative integer, zero, or a positive integer as this version is less than, 
 *    equal to, or greater than the specified version.     
 */
public int compareTo(HttpVersion anotherVer) {
  if (anotherVer == null) {
    throw new IllegalArgumentException("Version parameter may not be null"); 
  }
  int delta = getMajor() - anotherVer.getMajor();
  if (delta == 0) {
    delta = getMinor() - anotherVer.getMinor();
  }
  return delta;
}
origin: org.apache.commons/httpclient

/**
 * Compares this HTTP protocol version with another one.
 * 
 * @param anotherVer the version to be compared with.
 *  
 * @return a negative integer, zero, or a positive integer as this version is less than, 
 *    equal to, or greater than the specified version.     
 */
public int compareTo(HttpVersion anotherVer) {
  if (anotherVer == null) {
    throw new IllegalArgumentException("Version parameter may not be null"); 
  }
  int delta = getMajor() - anotherVer.getMajor();
  if (delta == 0) {
    delta = getMinor() - anotherVer.getMinor();
  }
  return delta;
}
origin: com.foxinmy/weixin4j-base

@Override
public HttpVersion getProtocol() {
  org.apache.commons.httpclient.HttpVersion version = httpMethod
      .getParams().getVersion();
  if (version == null) {
    return null;
  }
  Header connection = httpMethod.getResponseHeader("Connection");
  if (protocol == null) {
    protocol = new HttpVersion("HTTP", version.getMajor(),
        version.getMinor(), connection != null
            && KEEP_ALIVE.equalsIgnoreCase(connection
                .getValue()));
  }
  return protocol;
}
org.apache.commons.httpclientHttpVersiongetMajor

Javadoc

Returns the major version number of the HTTP protocol.

Popular methods of HttpVersion

  • parse
    Parses the textual representation of the given HTTP protocol version.
  • toString
  • equals
    Test if the HTTP protocol version is equal to the given number.
  • lessEquals
    Test if the HTTP protocol version is less or equal to the given number.
  • getMinor
    Returns the minor version number of the HTTP protocol.
  • greaterEquals
    Test if the HTTP protocol version is greater or equal to the given number.
  • <init>
    Create an HTTP protocol version designator.
  • compareTo
    Compares this HTTP protocol version with another one.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now