Package in.cs699.tensors.delagram.config
Class EnvironmentConfigurer
- java.lang.Object
-
- in.cs699.tensors.delagram.config.EnvironmentConfigurer
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.EnvironmentAware
@Configuration @PropertySource(value="classpath:application.properties", ignoreResourceNotFound=false) public class EnvironmentConfigurer extends Object implements org.springframework.context.EnvironmentAware
A configuration class to serve configuration services- Author:
- swaroop_nath
-
-
Constructor Summary
Constructors Constructor Description EnvironmentConfigurer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
formatDate(LocalDateTime timeStamp)
This method is used to convert the LocalDateTime object to a string.static String
getProperty(String key)
Getting value of properties from the properties file, using the key.static LocalDateTime
parseTime(String timeStamp)
This method is used to convert string representation of a time stamp back to LocalDateTime object.void
setEnvironment(org.springframework.core.env.Environment env)
Setting the Environment object.
-
-
-
Method Detail
-
getProperty
public static String getProperty(String key)
Getting value of properties from the properties file, using the key.- Parameters:
key
- The key for which the property value is desired.- Returns:
- Returns the value for the property.
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment env)
Setting the Environment object.- Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
formatDate
public static String formatDate(LocalDateTime timeStamp)
This method is used to convert the LocalDateTime object to a string. This is used to circumvent the issue of non-compatibility of LocalDateTime with Firestore TimeStamp.- Parameters:
timeStamp
- The time stamp which has to be stringified.- Returns:
- Returns the string representation of the time stamp, in the format yyyy-MMM-dd HH:mm:ss
-
parseTime
public static LocalDateTime parseTime(String timeStamp)
This method is used to convert string representation of a time stamp back to LocalDateTime object.- Parameters:
timeStamp
- The string representation of the time stamp, in the format yyyy-MMM-dd HH:mm:ss- Returns:
- Returns the LocalDateTime object corresponding to the time stamp.
-
-