-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.frc5572.util.profiler; | ||
|
||
/** Automatically profile a method. */ | ||
public @interface AutoProfile {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.frc5572.util.serde; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Repeatable; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Additional name this field could go by. Only used for deserialization, and only used if previous names/aliases are missing in log files. */ | ||
Check warning on line 9 in lib/src/main/java/org/frc5572/util/serde/Alias.java GitHub Actions / Linting
|
||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({ElementType.FIELD}) | ||
@Repeatable(Aliases.class) | ||
public @interface Alias { | ||
String value(); | ||
Check warning on line 14 in lib/src/main/java/org/frc5572/util/serde/Alias.java GitHub Actions / Linting
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.frc5572.util.serde; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.SOURCE) | ||
Check warning on line 8 in lib/src/main/java/org/frc5572/util/serde/Aliases.java GitHub Actions / Linting
|
||
@Target({ElementType.FIELD}) | ||
public @interface Aliases { | ||
Alias[] value(); | ||
Check warning on line 11 in lib/src/main/java/org/frc5572/util/serde/Aliases.java GitHub Actions / Linting
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.frc5572.util.serde; | ||
|
||
public enum Casing { | ||
Check warning on line 3 in lib/src/main/java/org/frc5572/util/serde/Casing.java GitHub Actions / Linting
|
||
LOWERCASE, | ||
UPPERCASE, | ||
PASCAL_CASE, | ||
CAMEL_CASE, | ||
SNAKE_CASE, | ||
SCREAMING_SNAKE_CASE, | ||
KEBAB_CASE, | ||
SCREAMING_KEBAB_CASE, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.frc5572.util.serde; | ||
|
||
/** Mark this class as the default serialization implementation for a given class. */ | ||
public @interface DefaultSerializer { | ||
Class<?> value(); | ||
Check warning on line 5 in lib/src/main/java/org/frc5572/util/serde/DefaultSerializer.java GitHub Actions / Linting
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.frc5572.util.serde; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Rename field in log table using the given name. */ | ||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({ElementType.FIELD}) | ||
public @interface Rename { | ||
String value(); | ||
Check warning on line 12 in lib/src/main/java/org/frc5572/util/serde/Rename.java GitHub Actions / Linting
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.frc5572.util.serde; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Rename all fields in serialized table using the given case conversions. This is ignored for any field with an explicit {@link Rename} annotation. */ | ||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({ElementType.TYPE}) | ||
public @interface RenameAll { | ||
Casing value(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.frc5572.util.serde; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** File supports serialization to and from a log table. */ | ||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({ElementType.TYPE}) | ||
public @interface Serde {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.frc5572.util.serde; | ||
|
||
/** Implementation for serialization/deserialization of a type. */ | ||
public interface Serialize<T> { | ||
|
||
void toTable(String name, T value); | ||
T fromTable(String name); | ||
Check warning on line 7 in lib/src/main/java/org/frc5572/util/serde/Serialize.java GitHub Actions / Linting
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.frc5572.util.serde; | ||
|
||
/** Indicates this item should be updated every call to `periodic()`. */ | ||
public @interface SingleSerdeItem { | ||
String name(); | ||
Check warning on line 5 in lib/src/main/java/org/frc5572/util/serde/SingleSerdeItem.java GitHub Actions / Linting
|
||
String updateInputs(); | ||
Check warning on line 6 in lib/src/main/java/org/frc5572/util/serde/SingleSerdeItem.java GitHub Actions / Linting
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.frc5572.util.serde; | ||
|
||
|
||
/** Indicates this field should be skipped during serialization and deserialization. */ | ||
public @interface Skip {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.frc5572.util.serde; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Use a field with type that implements {@link Serialize} for serialization instead of the default. */ | ||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({ElementType.FIELD}) | ||
public @interface With { | ||
Class<? extends Serialize<?>> value(); | ||
} |
This file was deleted.