Skip to content

Commit

Permalink
Ensure the weight value on @t elements is optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcsmith-net committed Aug 20, 2024
1 parent 8405e16 commit 767afcb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions praxiscore-code/src/main/java/org/praxislive/code/userapi/T.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2018 Neil C Smith.
* Copyright 2024 Neil C Smith.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3 only, as
Expand All @@ -19,7 +19,6 @@
* Please visit https://www.praxislive.org if you need additional information or
* have any questions.
*/

package org.praxislive.code.userapi;

import java.lang.annotation.ElementType;
Expand All @@ -30,19 +29,20 @@
/**
* Mark a field or method as a trigger (action). A control and port will be
* automatically created unless otherwise overridden. The @T annotation may be
* used on zero-parameter methods, and fields of type {@link Trigger} and boolean.
* NB. Note that boolean fields will be set to true when the trigger occurs and
* must be manually set back to false.
* used on zero-parameter methods, and fields of type {@link Trigger} and
* boolean. NB. Note that boolean fields will be set to true when the trigger
* occurs and must be manually set back to false.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
public @interface T {

/**
* Relative position compared to other @T elements. Values must be unique.
* They do not have to be contiguous.
* Relative weight compared to other {@code @T} elements. Elements will be
* sorted by weight, and then alphabetically. Higher weight elements will
* sort after lower weight elements.
*
* @return position
* @return weight
*/
int value();
int value() default 0;
}

0 comments on commit 767afcb

Please sign in to comment.