Package com.google.javascript.jscomp

# Class CodingConvention.AssertionFunctionSpec

java.lang.Object
com.google.javascript.jscomp.CodingConvention.AssertionFunctionSpec

Direct Known Subclasses:
  `ClosureCodingConvention.AssertInstanceofSpec`

Enclosing interface:
  `CodingConvention`

public static class CodingConvention.AssertionFunctionSpec extends Object
A function that will throw an exception when either: -One or more of its parameters evaluate to false. -One or more of its parameters are not of a certain type.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final JSTypeNative`
`assertedType`
`protected final String`
`functionName`

## Constructor Summary

Constructors
Constructor
Description
`AssertionFunctionSpec(String functionName)`
`AssertionFunctionSpec(String functionName, JSTypeNative assertedType)`

## Method Summary

Modifier and Type
Method
Description
`Node`
`getAssertedParam(Node firstParam)`
Returns the parameter of the assertion function that is being checked.
`JSType`
`getAssertedType(Node call, JSTypeRegistry registry)`
Returns the type for a type assertion, or null if the function asserts that the node must not be null or undefined.
`String`
`getFunctionName()`
Returns the name of the function.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### functionName

protected final String functionName

### assertedType

protected final JSTypeNative assertedType

## Constructor Details

### AssertionFunctionSpec

public AssertionFunctionSpec(String functionName)

### AssertionFunctionSpec

public AssertionFunctionSpec(String functionName, JSTypeNative assertedType)

## Method Details

### getFunctionName

public String getFunctionName()
Returns the name of the function.

### getAssertedParam

public Node getAssertedParam(Node firstParam)
Returns the parameter of the assertion function that is being checked.

Parameters:
  `firstParam` - The first parameter of the function call.

### getAssertedType

public JSType getAssertedType(Node call, JSTypeRegistry registry)
Returns the type for a type assertion, or null if the function asserts that the node must not be null or undefined.

Parameters:
  `call` - The asserting call