Sweet.apex

  • Docs
  • Tutorials
Docs Menu
  • Sweet.apex Core
    • Transpilation
    • Grammar
    • Command
    • Config
  • Features
    • Action
    • Apex Doc
    • Array Creation
    • Aspect
    • Cast
    • Default Value
    • Enum
    • File
    • Function
    • Identity
    • Injection
    • Lambda
    • Log
    • Mod
    • Not Null
    • Operator
    • Optional
    • Reflection
    • Rethrow
    • Switch
    • Template String
    • Template
    • Script
    • Tagged String
    • Annotation
    • Nullable
    • Var
    • Val
    • Map Access
    • Constructor
    • Transaction
    • Destructure
    • Import Static
    • Pipeline
    • Varargs
    • Patch
    • Import As
  • Plugin Development
    • Feature
    • Test Case

Import As Guide

Import As

Feature Overview

This feature enables importing a type as an alias.

Prerequisite

None.

Sweet Apex Example

import Query as Q;

public class ImportAsDemo {
    public static Q update(Q query) {
        return query;
    }
}

Transpiled Apex

public class ImportAsDemo {
    public static Query update(Query query) {
        return query;
    }
}

Usage

The alias should be a simple name.

Contribute on Github! Edit this section.