Auto Decorator

Generated implementations for common interfaces

License

License

Categories

Categories

Auto Application Layer Libs Code Generators
GroupId

GroupId

io.ashdavies.auto
ArtifactId

ArtifactId

auto-decorator
Last Version

Last Version

1.4.3
Release Date

Release Date

Type

Type

jar
Description

Description

Auto Decorator
Generated implementations for common interfaces
Project URL

Project URL

https://github.com/ashdavies/auto
Source Code Management

Source Code Management

https://github.com/ashdavies/auto

Download auto-decorator

How to add to project

<!-- https://jarcasting.com/artifacts/io.ashdavies.auto/auto-decorator/ -->
<dependency>
    <groupId>io.ashdavies.auto</groupId>
    <artifactId>auto-decorator</artifactId>
    <version>1.4.3</version>
</dependency>
// https://jarcasting.com/artifacts/io.ashdavies.auto/auto-decorator/
implementation 'io.ashdavies.auto:auto-decorator:1.4.3'
// https://jarcasting.com/artifacts/io.ashdavies.auto/auto-decorator/
implementation ("io.ashdavies.auto:auto-decorator:1.4.3")
'io.ashdavies.auto:auto-decorator:jar:1.4.3'
<dependency org="io.ashdavies.auto" name="auto-decorator" rev="1.4.3">
  <artifact name="auto-decorator" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.ashdavies.auto', module='auto-decorator', version='1.4.3')
)
libraryDependencies += "io.ashdavies.auto" % "auto-decorator" % "1.4.3"
[io.ashdavies.auto/auto-decorator "1.4.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Auto

Build Status Coverage License

Auto: Decorator

core compiler

Usage

dependencies {
  compile 'io.ashdavies.auto:auto-decorator:{current-version}'
  annotationProcessor 'io.ashdavies.auto:auto-decorator-compiler:{current-version}'
}

Normal Usage

Generate decorated implementations for interfaces or abstract classes.

@AutoDecorator
interface Listener {

  void onError(Throwable throwable);
}
listener = new ListenerDecorator(decorated);

Inner Class Usage

If you annotate an inner class its name will be prefixed with the outer class.

class Presenter {

  @AutoDecorator
  interface Listener {

    void onError(Throwable throwable);
  }
}
listener = new Presenter$ListenerDecorator(decorated);

Iterable Usage

Optionally you can generate an implementation that accepts multiple decorated classes. This only works for methods without a return type since the correct return cannot be distinguished. Return types will be supported with the implementation of merge strategies.

@AutoDecorator(iterable = true)
interface Listener {

  void onError(Throwable throwable)
}
listener = new ListenerDecorator(first, second, third);

Auto: No-Op

core compiler

Usage

dependencies {
  compile 'io.ashdavies.auto:auto-no-op:{current-version}'
  annotationProcessor 'io.ashdavies.auto:auto-no-op-compiler:{current-version}'
}

Normal Usage

Generate non operational implementations for interfaces or abstract classes.

@AutoNoOp
interface Listener {

  void onError(Throwable throwable);
}
listener = new ListenerNoOp();

Instance Usage

Optionally, you can instruct the processor to generate a static instance for repeated usage.

@AutoNoOp(instance = true)
interface Listener {

  void onError(Throwable throwable);
}
listener = ListenerNoOp.instance();

Auto: Value

core

Deprecated
Please use JakeWharton/AutoValueAnnotations instead

Usage

dependencies {
  compile 'io.ashdavies.auto:auto-value:{current-version}'
}

Versions

Version
1.4.3