if(value == null) {
throw new IllegalArgumentException("Provided component identifier may not be null");
}
if(value instanceof DefaultModuleComponentIdentifier) {
ModuleComponentIdentifier moduleComponentIdentifier = (ModuleComponentIdentifier)value;
encoder.writeByte(Implementation.MODULE.getId());
encoder.writeString(moduleComponentIdentifier.getGroup());
encoder.writeString(moduleComponentIdentifier.getModule());
encoder.writeString(moduleComponentIdentifier.getVersion());
} else if(value instanceof DefaultProjectComponentIdentifier) {
ProjectComponentIdentifier projectComponentIdentifier = (ProjectComponentIdentifier)value;
encoder.writeByte(Implementation.BUILD.getId());
encoder.writeString(projectComponentIdentifier.getProjectPath());
} else {