File tree Expand file tree Collapse file tree
src/GraphODataTemplateWriter/CodeHelpers/Java Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments