Packages

p

com.github.cerst

auto_require

package auto_require

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. auto_require
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait DisplayConfig extends AnyRef

    Sub-types of this trait change the error message generation of auto_require functions.

  2. final case class InfixOnlyOperators(value: Boolean) extends DisplayConfig with Product with Serializable

    Whether to infix single arg methods beside the standard operators such as '>', '==', ...

    Whether to infix single arg methods beside the standard operators such as '>', '==', ...

    Example:

    Instant.now.compareTo(otherInstant)   // false
    (Instant.now compareTo otherInstant)  // true

    Default: false

  3. final case class SimpleNameSegments(value: Int) extends DisplayConfig with Product with Serializable

    How many segments to use of a full name as simple name (mostly useful for nested types).
    Requesting more segment than available will result in a compile error.

    How many segments to use of a full name as simple name (mostly useful for nested types).
    Requesting more segment than available will result in a compile error.

    Example:

    val fullName = com.example.Object.NestedType
    val simpleName_1 = NestedType         // 1
    val simpleName_2 = Object.NestedType  // 2

    Default: 1

  4. final case class StripTypeNameSuffix(value: Boolean) extends DisplayConfig with Product with Serializable

    Whether to strip the suffix '.Type' from a full name before taking segments as simple name.
    This is mostly relevant for tagged value class implementations such as scala-newtype

    Whether to strip the suffix '.Type' from a full name before taking segments as simple name.
    This is mostly relevant for tagged value class implementations such as scala-newtype

    Example:

    package object types {
      @newtype
      final case class WidgetId(toInt: Int)
    
      val fullNameFalse = package.WidgetId.Type   // false
      val fullNameTrue  = package.WidgetId        // true
    }

    Default: true

    See also

    https://github.com/estatico/scala-newtype

Value Members

  1. macro def autoRequire[A](expression: Boolean, overrides: DisplayConfig*): Unit

    Tests the given expression, throwing an IllegalArgumentException if false.
    In contrast to Scala's standard require, error messages are generated automatically.

    Tests the given expression, throwing an IllegalArgumentException if false.
    In contrast to Scala's standard require, error messages are generated automatically.

    A

    Used to generate a context name as part of the error message. Must not be Nothing.

    expression

    The expression to test.

    overrides

    Allows for customizing the auto-generated error message. Check DisplayConfig and its sub-types for more info.

    returns

    Unit if and only if the given expression is true. Throws an IllegalArgumentException otherwise.

    Annotations
    @throws( ... )
  2. macro def autoRequireEither[A](expression: Boolean, overrides: DisplayConfig*): Either[String, Unit]

    Tests the given expression, returning a Left containing an error message if false.
    In contrast to Scala's standard require, error messages are generated automatically.

    Tests the given expression, returning a Left containing an error message if false.
    In contrast to Scala's standard require, error messages are generated automatically.

    A

    Used to generate a context name as part of the error message. Must not be Nothing.

    expression

    The expression to test.

    overrides

    Allows for customizing the auto-generated error message. Check DisplayConfig and its sub-types for more info.

    returns

    Left if and only if the given expression is true. Right

Inherited from AnyRef

Inherited from Any

Ungrouped