Java Code Examples for org.gradle.api.artifacts.component.ComponentSelector#getClass()

The following examples show how to use org.gradle.api.artifacts.component.ComponentSelector#getClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ComponentSelectorSerializer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void write(Encoder encoder, ComponentSelector value) throws IOException {
    if(value == null) {
        throw new IllegalArgumentException("Provided component selector may not be null");
    }

    if(value instanceof DefaultModuleComponentSelector) {
        ModuleComponentSelector moduleComponentSelector = (ModuleComponentSelector)value;
        encoder.writeByte(Implementation.MODULE.getId());
        encoder.writeString(moduleComponentSelector.getGroup());
        encoder.writeString(moduleComponentSelector.getModule());
        encoder.writeString(moduleComponentSelector.getVersion());
    } else if(value instanceof DefaultProjectComponentSelector) {
        ProjectComponentSelector projectComponentSelector = (ProjectComponentSelector)value;
        encoder.writeByte(Implementation.BUILD.getId());
        encoder.writeString(projectComponentSelector.getProjectPath());
    } else {
        throw new IllegalArgumentException("Unsupported component selector class: " + value.getClass());
    }
}
 
Example 2
Source File: ComponentSelectorSerializer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void write(Encoder encoder, ComponentSelector value) throws IOException {
    if(value == null) {
        throw new IllegalArgumentException("Provided component selector may not be null");
    }

    if(value instanceof DefaultModuleComponentSelector) {
        ModuleComponentSelector moduleComponentSelector = (ModuleComponentSelector)value;
        encoder.writeByte(Implementation.MODULE.getId());
        encoder.writeString(moduleComponentSelector.getGroup());
        encoder.writeString(moduleComponentSelector.getModule());
        encoder.writeString(moduleComponentSelector.getVersion());
    } else if(value instanceof DefaultProjectComponentSelector) {
        ProjectComponentSelector projectComponentSelector = (ProjectComponentSelector)value;
        encoder.writeByte(Implementation.BUILD.getId());
        encoder.writeString(projectComponentSelector.getProjectPath());
    } else {
        throw new IllegalArgumentException("Unsupported component selector class: " + value.getClass());
    }
}
 
Example 3
Source File: ComponentSelectorSerializer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void write(Encoder encoder, ComponentSelector value) throws IOException {
    if(value == null) {
        throw new IllegalArgumentException("Provided component selector may not be null");
    }

    if(value instanceof DefaultModuleComponentSelector) {
        ModuleComponentSelector moduleComponentSelector = (ModuleComponentSelector)value;
        encoder.writeByte(Implementation.MODULE.getId());
        encoder.writeString(moduleComponentSelector.getGroup());
        encoder.writeString(moduleComponentSelector.getModule());
        encoder.writeString(moduleComponentSelector.getVersion());
    } else if(value instanceof DefaultProjectComponentSelector) {
        ProjectComponentSelector projectComponentSelector = (ProjectComponentSelector)value;
        encoder.writeByte(Implementation.BUILD.getId());
        encoder.writeString(projectComponentSelector.getProjectPath());
    } else {
        throw new IllegalArgumentException("Unsupported component selector class: " + value.getClass());
    }
}
 
Example 4
Source File: ComponentSelectorSerializer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void write(Encoder encoder, ComponentSelector value) throws IOException {
    if(value == null) {
        throw new IllegalArgumentException("Provided component selector may not be null");
    }

    if(value instanceof DefaultModuleComponentSelector) {
        ModuleComponentSelector moduleComponentSelector = (ModuleComponentSelector)value;
        encoder.writeByte(Implementation.MODULE.getId());
        encoder.writeString(moduleComponentSelector.getGroup());
        encoder.writeString(moduleComponentSelector.getModule());
        encoder.writeString(moduleComponentSelector.getVersion());
    } else if(value instanceof DefaultProjectComponentSelector) {
        ProjectComponentSelector projectComponentSelector = (ProjectComponentSelector)value;
        encoder.writeByte(Implementation.BUILD.getId());
        encoder.writeString(projectComponentSelector.getProjectPath());
    } else {
        throw new IllegalArgumentException("Unsupported component selector class: " + value.getClass());
    }
}