Skip to main content

Getting Started

Add the dependency

pom.xml

<dependency>
<groupId>dev.cookiecode</groupId>
<artifactId>stylesniffer</artifactId>
<version>1.0.0</version>
</dependency>

Note: Use the latest version: Maven Central

Use StyleSniffer in your code

// Create an instance of StyleSniffer
var styleSniffer = StyleSnifferFactory.createStyleSniffer();

// Retrieve a CaseStyle and handle the result
Optional<CaseStyle> caseStyle = styleSniffer.getCaseStyle("myVariableName");
caseStyle.ifPresent(style -> System.out.println("Matched style: " + style.getName()));

// Retrieve and print supported case styles
Set<String> supportedStyles = styleSniffer.getSupportedCaseStyles();
System.out.println("Supported styles: " + supportedStyles);