Package net.sf.qualitycheck.exception

Examples of net.sf.qualitycheck.exception.IllegalStateOfArgumentException


   * @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException
   *             if the passed instance is empty
   */
  private static Data checkData(final Data data) {
    if (Data.EMPTY.equals(data)) {
      throw new IllegalStateOfArgumentException("Argument 'data' must not be empty.");
    }
    return data;
  }
View Full Code Here


    final File file = new File(CACHE_DIR, PREFIX + SUFFIX);
    if (!file.exists()) {
      try {
        file.createNewFile();
      } catch (final IOException e) {
        throw new IllegalStateOfArgumentException("Can not create a cache file.", e);
      }
    }
    return file;
  }
View Full Code Here

   */
  private static boolean isEmpty(@Nonnull final File file, @Nonnull final Charset charset) {
    try {
      return FileUtil.isEmpty(file, charset);
    } catch (final IOException e) {
      throw new IllegalStateOfArgumentException("The given file could not be read.", e);
    }
  }
View Full Code Here

  @Nonnull
  public DataBuilder appendBrowserBuilder(@Nonnull final Browser.Builder browserBuilder) {
    Check.notNull(browserBuilder, "browserBuilder");
    Check.notNegative(browserBuilder.getId(), "browserBuilder.getId()");
    if (browserBuilder.getType() == null && browserBuilder.getTypeId() < 0) {
      throw new IllegalStateOfArgumentException("A Type or Type-ID of argument 'browserBuilder' must be set.");
    }
    if (browserBuilders.containsKey(browserBuilder.getId())) {
      throw new IllegalStateOfArgumentException("The browser builder '" + browserBuilder.getProducer() + " "
          + browserBuilder.getFamily() + "' is already in the map.");
    }

    final Browser.Builder builder = browserBuilder.copy();
    browserBuilders.put(builder.getId(), builder);
View Full Code Here

  @Nonnull
  public DataBuilder appendDeviceBuilder(@Nonnull final Device.Builder deviceBuilder) {
    Check.notNull(deviceBuilder, "deviceBuilder");
    Check.notNegative(deviceBuilder.getId(), "deviceBuilder.getId()");
    if (deviceBuilders.containsKey(deviceBuilder.getId())) {
      throw new IllegalStateOfArgumentException("The device builder '" + deviceBuilder.getName() + "' is already in the map.");
    }

    final Device.Builder builder = deviceBuilder.copy();
    deviceBuilders.put(builder.getId(), builder);
    return this;
View Full Code Here

    URL ret = null;
    try {
      ret = new URL(url);
    } catch (final MalformedURLException e) {
      throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e);
    }
    return ret;
  }
View Full Code Here

    final List<String> segments = replaceNullValueWithEmptyGroup(groups);
    int i = 0;
    for (final String segment : segments) {
      if (!EMPTY_GROUP.equals(segment) && !isNumeric(segment)) {
        throw new IllegalStateOfArgumentException("The segment on position " + i + " (" + segment + ") must be a number.");
      }
      i++;
    }

    this.groups = segments;
View Full Code Here

TOP

Related Classes of net.sf.qualitycheck.exception.IllegalStateOfArgumentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.