RequireOS extends AbstractStandardEnforcerRule { @Override public String getCacheId() { StringBuilder b = new StringBuilder(); if ( StringUtils.isNotEmpty( version ) ) { b.append( version.hashCode() ); } if ( StringUtils.isNotEmpty( name ) ) { b.append( name.hashCode() ); } if ( StringUtils.isNotEmpty( arch ) ) { b.append( arch.hashCode() ); } if ( StringUtils.isNotEmpty( family ) ) { b.append( family.hashCode() ); } return b.toString(); } RequireOS();   RequireOS( ProfileActivator activator ); @Override void execute( EnforcerRuleHelper helper ); void displayOSInfo( Log log, boolean info ); boolean isAllowed(); boolean allParamsEmpty(); boolean isValidFamily( String theFamily ); String getArch(); void setArch( String theArch ); String getFamily(); void setFamily( String theFamily ); String getName(); void setName( String theName ); String getVersion(); void setVersion( String theVersion ); final void setDisplay( boolean display ); final boolean isDisplay(); @Override String getCacheId(); @Override boolean isCacheable(); @Override boolean isResultValid( EnforcerRule theCachedRule );  }
@Test public void testId() { RequireOS rule = new RequireOS(); rule.getCacheId(); }