Skip to content

Commit

Permalink
Add Placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
demengc committed Apr 12, 2024
1 parent 714dd4a commit 98c1dd0
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dev.demeng.pluginbase.model;

import dev.demeng.pluginbase.DynamicPlaceholders;
import java.util.function.UnaryOperator;
import lombok.Data;
import org.jetbrains.annotations.NotNull;

/**
* A shorthand version of {@link DynamicPlaceholders}, allowing for string placeholders to be easily
* applied on strings, lists, and item stacks.
*/
@Data(staticConstructor = "of")
public class Placeholders implements DynamicPlaceholders {

private final UnaryOperator<String> placeholderReplacer;

@Override
public @NotNull String setPlaceholders(@NotNull String str) {
return placeholderReplacer.apply(str);
}
}

0 comments on commit 98c1dd0

Please sign in to comment.