Skip to content

Commit f3d3495

Browse files
committed
Merge branch 'bugfix/java-stream-properties' of https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator into bugfix/java-stream-properties
2 parents 7fabd80 + ab7e128 commit f3d3495

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

src/GraphODataTemplateWriter/CodeHelpers/Java/TypeHelperJava.cs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -754,25 +754,18 @@ public static string CreatePackageDefForEnum(this CustomT4Host host)
754754
}
755755
public static string GetPackagePrefix(this OdcmObject obj)
756756
{
757-
if (obj is OdcmEnum)
757+
switch(obj)
758758
{
759-
return "models.generated";
760-
}
761-
else if (obj is OdcmType)
762-
{
763-
return GetPrefixForModels();
764-
}
765-
else if (obj is OdcmParameter)
766-
{
767-
return GetPackagePrefix((obj as OdcmParameter).Type);
768-
}
769-
else if (obj is OdcmProperty)
770-
{
771-
return GetPackagePrefix((obj as OdcmProperty).Type);
772-
}
773-
else
774-
{
775-
throw new ArgumentException("obj");
759+
case OdcmEnum e:
760+
return "";
761+
case OdcmType t:
762+
return GetPrefixForModels();
763+
case OdcmParameter p:
764+
return GetPackagePrefix(p.Type);
765+
case OdcmProperty p:
766+
return GetPackagePrefix(p.Type);
767+
default:
768+
throw new ArgumentException(nameof(obj));
776769
}
777770
}
778771
public static string CreatePackageDefinition(this CustomT4Host host)

0 commit comments

Comments
 (0)