@Test public void testOsFamily() { assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.CENTOS), OsFamily.CENTOS); assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.DEBIAN), OsFamily.DEBIAN); assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.RHEL), OsFamily.RHEL); assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.UBUNTU), OsFamily.UBUNTU); assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.WINDOWS), OsFamily.WINDOWS); assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.CLOUD_LINUX), OsFamily.CLOUD_LINUX); assertEquals(OperatingSystems.osFamily().apply(OperatingSystems.VYATTACE), OsFamily.LINUX); }
public static Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.startsWith(CENTOS)) return OsFamily.CENTOS; else if (description.startsWith(DEBIAN)) return OsFamily.DEBIAN; else if (description.startsWith(RHEL)) return OsFamily.RHEL; else if (description.startsWith(UBUNTU)) return OsFamily.UBUNTU; else if (description.startsWith(WINDOWS)) return OsFamily.WINDOWS; else if (description.startsWith(CLOUD_LINUX)) return OsFamily.CLOUD_LINUX; else if (description.startsWith(VYATTACE)) return OsFamily.LINUX; } return OsFamily.UNRECOGNIZED; } }; }
OperatingSystems { public static Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.startsWith(CENTOS)) return OsFamily.CENTOS; else if (description.startsWith(DEBIAN)) return OsFamily.DEBIAN; else if (description.startsWith(RHEL)) return OsFamily.RHEL; else if (description.startsWith(UBUNTU)) return OsFamily.UBUNTU; else if (description.startsWith(WINDOWS)) return OsFamily.WINDOWS; else if (description.startsWith(CLOUD_LINUX)) return OsFamily.CLOUD_LINUX; else if (description.startsWith(VYATTACE)) return OsFamily.LINUX; } return OsFamily.UNRECOGNIZED; } }; } }
OperatingSystems { public static Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.startsWith(CENTOS)) return OsFamily.CENTOS; else if (description.startsWith(DEBIAN)) return OsFamily.DEBIAN; else if (description.startsWith(RHEL)) return OsFamily.RHEL; else if (description.startsWith(UBUNTU)) return OsFamily.UBUNTU; else if (description.startsWith(WINDOWS)) return OsFamily.WINDOWS; else if (description.startsWith(CLOUD_LINUX)) return OsFamily.CLOUD_LINUX; else if (description.startsWith(VYATTACE)) return OsFamily.LINUX; } return OsFamily.UNRECOGNIZED; } }; }  }
OperatingSystems { public static Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.startsWith(CENTOS)) return OsFamily.CENTOS; else if (description.startsWith(DEBIAN)) return OsFamily.DEBIAN; else if (description.startsWith(RHEL)) return OsFamily.RHEL; else if (description.startsWith(UBUNTU)) return OsFamily.UBUNTU; else if (description.startsWith(WINDOWS)) return OsFamily.WINDOWS; else if (description.startsWith(CLOUD_LINUX)) return OsFamily.CLOUD_LINUX; else if (description.startsWith(VYATTACE)) return OsFamily.LINUX; } return OsFamily.UNRECOGNIZED; } }; }  static Function<String, OsFamily> osFamily(); static Function<String, Integer> bits(); static Function<String, String> version(); }
OperatingSystems { public static Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.startsWith(CENTOS)) return OsFamily.CENTOS; else if (description.startsWith(DEBIAN)) return OsFamily.DEBIAN; else if (description.startsWith(RHEL)) return OsFamily.RHEL; else if (description.startsWith(UBUNTU)) return OsFamily.UBUNTU; else if (description.startsWith(WINDOWS)) return OsFamily.WINDOWS; else if (description.startsWith(CLOUD_LINUX)) return OsFamily.CLOUD_LINUX; else if (description.startsWith(VYATTACE)) return OsFamily.LINUX; } return OsFamily.UNRECOGNIZED; } }; }  static Function<String, OsFamily> osFamily(); static Function<String, Integer> bits(); static Function<String, String> version();  }