org.apache.skywalking.apm.dependencies.net.bytebuddy.utility.privilege.GetSystemPropertyAction Maven / Gradle / Ivy
package org.apache.skywalking.apm.dependencies.net.bytebuddy.utility.privilege;
import org.apache.skywalking.apm.dependencies.net.bytebuddy.build.HashCodeAndEqualsPlugin;
import java.security.PrivilegedAction;
/**
* An action for reading a system property as a privileged action.
*/
@HashCodeAndEqualsPlugin.Enhance
public class GetSystemPropertyAction implements PrivilegedAction {
/**
* The property key.
*/
private final String key;
/**
* Creates a new action for reading a system property.
*
* @param key The property key.
*/
public GetSystemPropertyAction(String key) {
this.key = key;
}
/**
* {@inheritDoc}
*/
public String run() {
return System.getProperty(key);
}
}