private static string GetCollectionTypeName(string elementTypeName, OutputCollectionType type) { switch (type) { //case OutputCollectionType.Array: return elementTypeName + "[]"; case OutputCollectionType.Array: return(elementTypeName + "[]"); case OutputCollectionType.MutableList: return("List<" + elementTypeName + ">?"); // case OutputCollectionType.IReadOnlyList: return "IReadOnlyList<" + elementTypeName + ">"; // case OutputCollectionType.ImmutableArray: return "ImmutableArray<" + elementTypeName + ">"; default: throw new ArgumentOutOfRangeException(paramName: nameof(type), actualValue: type, message: "Invalid " + nameof(OutputCollectionType) + " enum value."); } }
private static string GetCollectionTypeName(string elementTypeName, OutputCollectionType type) { switch (type) { case OutputCollectionType.Array: return(elementTypeName + "[]"); case OutputCollectionType.MutableList: return("ArrayList<" + elementTypeName + ">"); case OutputCollectionType.IReadOnlyList: case OutputCollectionType.ImmutableArray: throw new NotSupportedException("Java does not have in-box interfaces for read-only and immutable collections."); default: throw new ArgumentOutOfRangeException(paramName: nameof(type), actualValue: type, message: "Invalid " + nameof(OutputCollectionType) + " enum value."); } }