Skip to content

mrFunkyWisdom/PropertiesReader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PropertiesReader

load values from properties file

maven usage :

<dependency>
	<groupId>io.github.ensyb.properties</groupId>
	<artifactId>PropertiesReader</artifactId>
	<version>0.1.3</version>
</dependency>
@Source("package/testProperties.properties")
public interface ConstantsWithSource extends IConstants {

	@Key("first")
	@DefaultValue("defaultFirstValue")
	public String firstProperty();
  
  }
  
//usage
//if there is no key "first" in file default value will be used 
ConstantsWithSource constants = PropertiesLoader.of(ConstantsWithSource.class);
String value = constants.firstProperty();

//loader can be used without source

	@DefaultValue("defaultValue")
  //or
  @Value("defaultValue")
	public String firstProperty();
  
  ConstantsWithSource constants = PropertiesLoader.ofNoSource(ConstantsWithSource.class);

About

properties resource reader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages