com.github.jeuxjeux20.relativesorting.Order Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of relative-sorting Show documentation
Show all versions of relative-sorting Show documentation
Sort elements using relative constraints.
package com.github.jeuxjeux20.relativesorting;
import com.github.jeuxjeux20.relativesorting.config.DefaultPositionProvider;
import java.lang.annotation.*;
/**
* Specifies the relative constraints on the position of elements
* using this class as an identifier.
*/
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Order {
/**
* Returns the classes that this element should precede.
*
* @return the classes that this element should precede
*/
Class>[] before() default {};
/**
* Returns the classes that this element should succeed.
*
* @return the classes that this element should succeed
*/
Class>[] after() default {};
/**
* Defines the position of the element when its
* exact position cannot be determined.
*
* A higher value will put this element further in the list,
* while a lower value will put it closer.
*
* Note that a value of 0 is considered default and will get processed by
* a {@link DefaultPositionProvider}.
*
* @return the position of the element
*/
int position() default 0;
}