Java 8 InvalidParameterException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvalidParameterException class.

This code example shows how to use the following methods:
            int             strength,
            SecureRandom    random)
        { 
            if (strength < 512 || strength > 1024 || strength % 64 != 0)
            { 
                throw new InvalidParameterException("strength must be from 512 - 1024 and a multiple of 64");
            } 
 
            this.strength = strength;
            this.random = random;
        } 
 
        protected void engineInit( 
            AlgorithmParameterSpec  genParamSpec,
            SecureRandom            random)
            throws InvalidAlgorithmParameterException 
        { 
            throw new InvalidAlgorithmParameterException("No supported AlgorithmParameterSpec for DSA parameter generation.");
        } 
 
6
CodeRank
This code example shows how to use the following methods:
     *   dont use VOICE_RECOGNITION_REQUEST_CODE, this is reserved for the other constructor 
     */ 
    public VoiceInputAssistant(ImageButton voiceButton, int requestCode) {
        this(voiceButton);
        if (requestCode == VOICE_RECOGNITION_REQUEST_CODE)
            throw new InvalidParameterException("You have to specify a unique requestCode for this VoiceInputAssistant!");
        this.requestCode = requestCode;
    } 
 
    /** 
     * Creates a new VoiceInputAssistance-instance for use with a specified button and textfield. 
     * If you need more than one microphone-button on a given fragment, use the other constructor. 
     * 
     * @param activity the activity which holds the microphone-buttone and the textField to insert recognized test 
     * @param voiceButton the microphone-Button 
     * @param textField the textfield that should get the resulttext 
     */ 
    public VoiceInputAssistant(Activity activity, ImageButton voiceButton) {
        Assert.assertNotNull("Each VoiceInputAssistant must be bound to a activity!", activity);
        Assert.assertNotNull("A VoiceInputAssistant without a voiceButton makes no sense!", voiceButton);
6
CodeRank
This code example shows how to use the following methods:
 
public class MyKeyPairGeneratorSpi extends KeyPairGeneratorSpi { 
 
    public void initialize(int keysize, SecureRandom random) { 
        if (keysize < 100) { 
            throw new InvalidParameterException( 
                    "Invalid keysize: less than 100"); 
        } 
        if (random == null) { 
            throw new IllegalArgumentException("Invalid random"); 
        } 
    } 
 
    public KeyPair generateKeyPair() { 
        return null; 
    } 
 
    public void initialize(AlgorithmParameterSpec params, SecureRandom random) 
            throws InvalidAlgorithmParameterException { 
        if (random == null) { 
6
CodeRank
This code example shows how to use the following methods:getCause, getMessage
     * Assertion: constructs InvalidParameterException when <code>msg</code> 
     * is null 
     */ 
    public void testInvalidParameterException03() { 
        String msg = null;
        InvalidParameterException tE = new InvalidParameterException(msg);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
} 
6
CodeRank
This code example shows how to use the following methods:
    this.protocol = protocol;
    this.path = path;
 
    CapabilityMatcher c = proxy.getCapabilityHelper();
    if (c == null) {
      throw new InvalidParameterException("the proxy needs to have a valid "
          + "capabilityMatcher to support have some test slots attached to it"); 
    } 
    matcher = proxy.getCapabilityHelper();
    this.capabilities = capabilities;
  } 
 
  public Map<String, Object> getCapabilities() {
    return Collections.unmodifiableMap(capabilities);
  } 
 
  /** 
   * @return the RemoteProxy that hosts this slot. 
   */ 
  public RemoteProxy getProxy() { 
6
CodeRank
This code example shows how to use the following methods:
        private final long modified;
 
        ModifiedFile(File file) {
            this.file = file;
            this.modified = file.lastModified();
        } 
 
        File getFile() {
            return file;
        } 
 
        long getModified() { 
            return modified;
        } 
 
        @Override 
        public int compareTo(ModifiedFile another) {
            if (getModified() < another.getModified()) {
                return -1; 
            } else if (getModified() > another.getModified()) {
6
CodeRank
This code example shows how to use the following methods:
    path = path.replace(variable, value);
  } 
 
  private void validateContains(String variable) {
    if (!path.contains(variable)) {
      throw new InvalidParameterException(path + " doesn't have " + variable + " as a variable.");
    } 
  } 
 
  public String getPath() {
    return path;
  } 
 
 
 
} 
5
CodeRank
This code example shows how to use the following methods:
	/** 
	 * Get the Id of the section 
	 */ 
	public Long getSectionId(String section) {
		if (headers == null) {
			throw new InvalidParameterException(ERRORMSG);
		} 
		return sectionIds.get(section);
	} 
	 
	/** 
	 * Get the Id of the section a position is contained in 
	 */ 
	public Long getSectionIdOfPos(final int position) {
		return getSectionId(getSection(position));
	} 
 
	/** 
	 * Get the section a position is contained in. 
	 */ 
5
CodeRank
This code example shows how to use the following methods:
            engine.init(new KeyGenerationParameters(random, keySize));
            uninitialised = false;
        } 
        catch (IllegalArgumentException e)
        { 
            throw new InvalidParameterException(e.getMessage());
        } 
    } 
 
    protected SecretKey engineGenerateKey()
    { 
        if (uninitialised)
        { 
            engine.init(new KeyGenerationParameters(new SecureRandom(), defaultKeySize));
            uninitialised = false;
        } 
 
        return new SecretKeySpec(engine.generateKey(), algName);
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
        int strength,
        SecureRandom random)
    { 
        if (strength < 512 || strength > 1024 || strength % 64 != 0)
        { 
            throw new InvalidParameterException("strength must be from 512 - 1024 and a multiple of 64");
        } 
 
        this.strength = strength;
        this.random = random;
    } 
 
    public void initialize( 
        AlgorithmParameterSpec params,
        SecureRandom random)
        throws InvalidAlgorithmParameterException 
    { 
        if (!(params instanceof DSAParameterSpec))
        { 
            throw new InvalidAlgorithmParameterException("parameter object not a DSAParameterSpec");
5
CodeRank

Related Java 8 InvalidParameterException Questions & Answers:

See Code Examples for Java 8 InvalidParameterException Methods: